FormulaEngineer — A Highly Accurate Excel Formula Engine with support for 430+ Excel functions — explore the complete list NEW3.0.1

FormulaEngineer examples

Create, read, and style Excel workbooks in .NET.

Style workbooks as you write them — fonts, fills, borders, number formats, alignment, and layout — using ExcelStyledWriter. Every example below is a complete, runnable snippet.

Group
Example
10 examples in Layout

Fixed-width columns

Sets an explicit width per column before the first row is written, so a description column gets room to breathe while code and owner columns stay narrow.

Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;

var headerStyle =
    ExcelStyle.Default.With(
        font: ExcelFontStyle.Default.With(
            bold: true,
            color: ExcelColor.FromRgb(255, 255, 255)),
        fill: ExcelFillStyle.Solid(
            ExcelColor.FromRgb(31, 78, 121)));

using (var writer = new ExcelStyledWriter("fixed-width-columns.xlsx"))
{
    using (var sheet = writer.CreateWorksheet("Layout"))
    {
        sheet.SetColumnStyle(1, ExcelColumnStyle.Default.With(width: 14d));
        sheet.SetColumnStyle(2, ExcelColumnStyle.Default.With(width: 32d));
        sheet.SetColumnStyle(3, ExcelColumnStyle.Default.With(width: 16d));

        sheet.WriteRow(
            new object?[] { "Code", "Description", "Owner" },
            headerStyle);

        sheet.WriteRow("A-100", "Formula calculation service", "Finance");
        sheet.WriteRow("B-200", "Streaming workbook export", "Operations");
        sheet.WriteRow("C-300", "Dashboard package", "Sales");
    }

    writer.Close();
}

Style your own workbooks

Styling is part of the same package — no separate install, no Excel, no COM automation.