SharpCell
SharpCell is a free (MIT) Excel formula engine for .NET 8 and later: it reads .xlsx files, recalculates them, saves the results back and evaluates formulas, including dynamic arrays and LET/LAMBDA.
Correctness
Results are compared with workbooks calculated by Microsoft Excel. The compatibility report lists every function, its status and how many Excel-calculated cells it matches.
Packages
| Package | What it does |
|---|---|
SharpCell |
The engine: parser, values, recalculation and functions. No dependencies. |
SharpCell.Xlsx |
Reads .xlsx files into a SharpCell workbook and saves recalculated values back. |
Install from NuGet:
dotnet add package SharpCell.Xlsx
A first example
var workbook = new Workbook();
Worksheet sheet = workbook.AddSheet("Sheet1");
sheet["A1"].Value = 2;
sheet["A2"].Formula = "=A1*3";
workbook.Recalculate();
CellValue result = sheet["A2"].Value; // 6
Next
- Getting started: install, read a file, recalculate, read values.
- Formulas and values: syntax, references, dynamic arrays, names and LAMBDA.
- Cells, ranges and dates: going through cells, blocks of values, dates, defined names.
- Recalculation: when values update, changed cells, precedents, threads, templates.
- Custom functions: functions written in C# that formulas call.
- Reading .xlsx files: what the reader loads and what it skips.
- Saving .xlsx files: writing recalculated values back into a template.
- Functions: function status, criteria, dates.
- What SharpCell does not do: every known gap.
- API reference: every public type and member.
- For AI coding agents: llms.txt and rules for your agent.