SharpCell

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