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

Right-aligned financial columns

Left-aligns account labels and right-aligns currency amounts so decimal points line up down the column — the convention every finance reader expects.

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 labelStyle =
		ExcelStyle.Default.With(
				alignment: ExcelAlignmentStyle.Default.With(
						horizontal: ExcelHorizontalAlignment.Left));

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

using (var writer = new ExcelStyledWriter("right-aligned-financial-columns.xlsx"))
{
	using (var sheet = writer.CreateWorksheet("Finance"))
	{
		sheet.WriteRow(
				new object?[] { "Account", "Budget", "Actual" },
				headerStyle);

		sheet.WriteRow(
				new object?[] { "Product", 50000m, 47250m },
				new ExcelStyle?[] { labelStyle, amountStyle, amountStyle });

		sheet.WriteRow(
				new object?[] { "Marketing", 25000m, 26890m },
				new ExcelStyle?[] { labelStyle, amountStyle, amountStyle });

		sheet.WriteRow(
				new object?[] { "Operations", 30000m, 29110m },
				new ExcelStyle?[] { labelStyle, amountStyle, amountStyle });
	}

	writer.Close();
}

Style your own workbooks

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