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 Cells and text

Highlighted input cells

Marks the cells a user is meant to edit with a pale yellow fill and leaves calculated cells unfilled, so the sheet communicates which values are inputs and which are derived.

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

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)),
				alignment: ExcelAlignmentStyle.Default.With(
						horizontal: ExcelHorizontalAlignment.Center));

var inputStyle =
		ExcelStyle.Default.With(
				fill: ExcelFillStyle.Solid(
						ExcelColor.FromRgb(255, 242, 204)));

var currencyStyle =
		ExcelStyle.Default.With(
				numberFormat: ExcelNumberFormatStyle.Custom("$#,##0.00"));

using (var writer = new ExcelStyledWriter("highlighted-input-cells.xlsx"))
{
	using (var sheet = writer.CreateWorksheet("Inputs"))
	{
		sheet.WriteRow(
				new object?[] { "Item", "Quantity", "Unit price", "Total" },
				headerStyle);

		sheet.WriteRow(
				new object?[] { "License", 2, 499m, ExcelFormula.From("B2*C2") },
				new ExcelStyle?[] { null, inputStyle, inputStyle, currencyStyle });

		sheet.WriteRow(
				new object?[] { "Support", 1, 275m, ExcelFormula.From("B3*C3") },
				new ExcelStyle?[] { null, inputStyle, inputStyle, currencyStyle });
	}

	writer.Close();
}

Style your own workbooks

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