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

Column default currency style

Attaches a style to the column itself rather than to each cell, so every value written into that column picks up the currency format without a per-cell style array.

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

var currencyStyle =
    ExcelStyle.Default.With(
        numberFormat: ExcelNumberFormatStyle.Custom("$#,##0.00"),
        alignment: ExcelAlignmentStyle.Default.With(
            horizontal: ExcelHorizontalAlignment.Right));

using (var writer = new ExcelStyledWriter("column-default-currency-style.xlsx"))
{
    using (var sheet = writer.CreateWorksheet("Budget"))
    {
        sheet.SetColumnStyle(1, ExcelColumnStyle.Default.With(width: 18d));
        sheet.SetColumnStyle(2, ExcelColumnStyle.Default.With(width: 14d, style: currencyStyle));
        sheet.SetColumnStyle(3, ExcelColumnStyle.Default.With(width: 14d, style: currencyStyle));

        sheet.WriteRow("Department", "Budget", "Actual");
        sheet.WriteRow("Engineering", 50000m, 47250m);
        sheet.WriteRow("Marketing", 25000m, 26890m);
        sheet.WriteRow("Operations", 30000m, 29110m);
    }

    writer.Close();
}

Style your own workbooks

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