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
6 examples in Conditional formatting

Highlight a target band

EnableConditionalFormatting

Uses a Between operator with two bounds to shade margins that fall inside an acceptable range, leaving outliers on either side visually unmarked.

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

var stylingOptions =
    new ExcelStylingOptions
    {
        EnableConditionalFormatting = true
    };

var targetBandStyle =
    ExcelStyle.Default.With(
        fill: ExcelFillStyle.Solid(ExcelColor.FromRgb(221, 235, 247)));

using (var writer = new ExcelStyledWriter("between-band-highlight.xlsx", null, stylingOptions))
{
    using (var sheet = writer.CreateWorksheet("Margins"))
    {
        sheet.WriteRow("Product", "Margin");
        sheet.WriteRow("Formula Engine", 0.18);
        sheet.WriteRow("Streaming Writer", 0.09);
        sheet.WriteRow("Dashboard Pack", 0.22);
        sheet.WriteRow("Support Plan", 0.15);

        sheet.AddConditionalFormat(
            "B2:B5",
            ExcelConditionalFormat.CellValue(
                ExcelConditionalFormatOperator.Between,
                "0.10",
                "0.20",
                style: targetBandStyle));
    }

    writer.Close();
}

Style your own workbooks

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