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
Cells and text
10
Layout
10
Conditional formatting
6
Named styles and themes
4
Tables and notes
10
Images and shapes
4
Charts and sparklines
6
Dashboards
4
Example
10
examples
in Tables and notes
Annotated financial report
EnableTables EnableComments EnableThreadedCommentsEverything in this group applied to one sheet — a styled table with variance formulas, a note explaining the calculation, and a threaded comment raising a question on a specific figure.
Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;
using System;
var stylingOptions =
new ExcelStylingOptions
{
EnableTables = true,
EnableComments = true,
EnableThreadedComments = true
};
var financeReviewer =
ExcelThreadedCommentPerson.Create(
"Mira",
"mira@example.com",
"PeoplePicker");
using (var writer = new ExcelStyledWriter("annotated-financial-report.xlsx", null, stylingOptions))
{
using (var sheet = writer.CreateWorksheet("Finance"))
{
sheet.WriteRow("Account", "Budget", "Actual", "Variance");
sheet.WriteRow("Engineering", 50000m, 47250m, ExcelFormula.From("B2-C2"));
sheet.WriteRow("Marketing", 25000m, 26890m, ExcelFormula.From("B3-C3"));
sheet.WriteRow("Operations", 30000m, 29110m, ExcelFormula.From("B4-C4"));
sheet.AddTable(
ExcelTable.Create(
"FinanceTable",
"A1:D4",
new[]
{
ExcelTableColumn.Create("Account"),
ExcelTableColumn.Create("Budget"),
ExcelTableColumn.Create("Actual"),
ExcelTableColumn.Create("Variance")
},
ExcelTableStyle.Create("TableStyleMedium7")));
sheet.AddNote(
"D1",
ExcelNote.Create(
"Variance is calculated as Budget minus Actual.",
"John"));
sheet.AddThreadedComment(
"C3",
ExcelThreadedComment.Create(
"Marketing actuals need finance approval.",
financeReviewer,
new DateTimeOffset(2026, 7, 22, 11, 15, 0, TimeSpan.Zero)));
}
writer.Close();
}
Style your own workbooks
Styling is part of the same package — no separate install, no Excel, no COM automation.