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
4 examples in Named styles and themes

Per-cell named styles

EnableNamedStyles

Registers two named styles up front and applies them per cell via a named-style array, mixing a currency style and a warning style within a single row.

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

var stylingOptions =
    new ExcelStylingOptions
    {
        EnableNamedStyles = true
    };

using (var writer = new ExcelStyledWriter("per-cell-named-styles.xlsx", null, stylingOptions))
{
    var moneyStyle =
        writer.RegisterNamedStyle(
            ExcelNamedStyle.Create(
                "Money",
                ExcelStyle.Default.With(
                    numberFormat: ExcelNumberFormatStyle.Custom("$#,##0.00"))));

    var warningStyle =
        writer.RegisterNamedStyle(
            ExcelNamedStyle.Create(
                "Warning",
                ExcelStyle.Default.With(
                    font: ExcelFontStyle.Default.With(bold: true),
                    fill: ExcelFillStyle.Solid(ExcelColor.FromRgb(255, 199, 206)))));

    using (var sheet = writer.CreateWorksheet("Named Cells"))
    {
        sheet.WriteRow("Item", "Amount", "Status");

        sheet.WriteRowWithNamedStyles(
            new object?[] { "License", 998m, "Approved" },
            new ExcelNamedStyle?[] { null, moneyStyle, null });

        sheet.WriteRowWithNamedStyles(
            new object?[] { "Support", 275m, "Review" },
            new ExcelNamedStyle?[] { null, moneyStyle, warningStyle });
    }

    writer.Close();
}

Style your own workbooks

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