DotnetPoi.Formula
0.1.0
dotnet add package DotnetPoi.Formula --version 0.1.0
NuGet\Install-Package DotnetPoi.Formula -Version 0.1.0
<PackageReference Include="DotnetPoi.Formula" Version="0.1.0" />
<PackageVersion Include="DotnetPoi.Formula" Version="0.1.0" />
<PackageReference Include="DotnetPoi.Formula" />
paket add DotnetPoi.Formula --version 0.1.0
#r "nuget: DotnetPoi.Formula, 0.1.0"
#:package DotnetPoi.Formula@0.1.0
#addin nuget:?package=DotnetPoi.Formula&version=0.1.0
#tool nuget:?package=DotnetPoi.Formula&version=0.1.0
DotnetPoi.Formula
Formula evaluator for dotnet-poi — evaluate spreadsheet formulas in xlsx workbooks.
⚠️ This is an unofficial port and is not affiliated with the Apache Software Foundation. Apache POI is a registered trademark of the Apache Software Foundation.
Install
dotnet add package DotnetPoi.Formula
<PackageReference Include="DotnetPoi.Formula" Version="0.1.0" />
Requires DotnetPoi.Core 0.1.0+ and .NET 8.0+ or .NET Framework 4.7.2+.
Documentation
When to use
| Use DotnetPoi.Formula if you need… | Don't need it if you only… |
|---|---|
IFormulaEvaluator.evaluate() / evaluateAll() / evaluateInCell() |
Read/write formula text and cached values |
| Programmatic access to freshly calculated results | Template fill → save → open in Excel |
| Use SUM, AVERAGE, COUNT, MIN, MAX, CONCATENATE | Write/save/reload xlsx files without calculation |
All formula text preservation (
setCellFormula,getCellFormula, cached<v>value) lives in DotnetPoi.Core and works without this package.
How it works
DotnetPoi.Formula references DotnetPoi.Core, not the other way around. When this package is in your project, createFormulaEvaluator() is automatically enabled via lazy assembly discovery (Type.GetType + RuntimeHelpers.RunClassConstructor). No configuration needed — just add the NuGet reference.
Usage
using DotnetPoi.SS.UserModel;
using DotnetPoi.XSSF.UserModel;
using var wb = new XSSFWorkbook();
var sheet = wb.createSheet();
sheet.createRow(0).createCell(0).setCellValue(10);
sheet.getRow(0).createCell(1).setCellValue(20);
sheet.getRow(0).createCell(2).setCellFormula("A1+B1");
var evaluator = wb.getCreationHelper().createFormulaEvaluator();
evaluator.evaluateAll();
Console.WriteLine(sheet.getRow(0).getCell(2).getNumericCellValue()); // 30
Supported formulas
Operators
| Operator | Description | Example |
|---|---|---|
+ |
Addition | A1+B1 |
- |
Subtraction | A1-B1 |
* |
Multiplication | A1*B1 |
/ |
Division | A1/B1 |
& |
String concatenation | "hello "&"world" |
Cell references
| Syntax | Description | Example |
|---|---|---|
A1 |
Single cell | A1+10 |
A1:C1 |
Range (in functions) | SUM(A1:C1) |
Functions
| Function | Signature | Description |
|---|---|---|
SUM |
SUM(number1, [number2], …) |
Sums numeric arguments. Non-numeric values ignored. |
AVERAGE |
AVERAGE(number1, [number2], …) |
Arithmetic mean. |
MIN |
MIN(number1, [number2], …) |
Minimum value. |
MAX |
MAX(number1, [number2], …) |
Maximum value. |
COUNT |
COUNT(value1, [value2], …) |
Counts numeric values. |
CONCATENATE |
CONCATENATE(text1, [text2], …) |
Joins text arguments. |
Unsupported (not yet implemented)
Comparison / logical operators
=, <>, <, >, <=, >=, IF
Lookup / reference
VLOOKUP, HLOOKUP, INDEX, MATCH, XLOOKUP, OFFSET, INDIRECT
Math / trig
ABS, ROUND, ROUNDUP, ROUNDDOWN, INT, MOD, POWER, SQRT, CEILING, FLOOR, RAND, RANDBETWEEN, PI, SIN, COS, TAN, LOG, LN
Text
LEFT, RIGHT, MID, LEN, FIND, SEARCH, REPLACE, SUBSTITUTE, UPPER, LOWER, PROPER, TRIM, TEXT
Date / time
TODAY, NOW, DATE, YEAR, MONTH, DAY, DATEDIF, WEEKDAY
Logical
AND, OR, NOT, IFERROR, IFNA, SWITCH
Statistical
MEDIAN, MODE, STDEV, STDEVP, VAR, VARP, QUARTILE, PERCENTILE, LARGE, SMALL, RANK, CORREL
Financial
PMT, FV, PV, NPV, IRR, RATE, NPER
Information
ISBLANK, ISNUMBER, ISTEXT, ISERROR, ISERR, TYPE, NA
Rounding
MROUND, TRUNC, EVEN, ODD
Version
This is a v0.x package. The supported function set will grow over time independently of DotnetPoi.Core, which targets v1.0 stability.
Test coverage
| Project | Tests |
|---|---|
| Formula.Tests | 10 |
License
Apache License 2.0 — same as upstream Apache POI.
Disclaimer
This project is not affiliated with the Apache Software Foundation or the Apache POI project. Apache POI is a registered trademark of the Apache Software Foundation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- DotnetPoi.Core (>= 0.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DotnetPoi.Formula:
| Package | Downloads |
|---|---|
|
DotnetPoi.All
Meta package shell for the complete DotnetPoi surface: OOXML, legacy binary formats, POIFS, and Formula. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 185 | 5/6/2026 |