Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

FormulaEngineer

FormulaEngineer

The Excel formula engine for .NET.
Create, read, recalculate and style .xlsx workbooks in C#.
No Excel install. No COM interop. Pure managed code.

NuGet 461 functions .NET 6+

Windows Linux macOS Docker Azure Functions AWS Lambda

Live demo · Functions · Validation · Examples · Styling · Pricing · Contact


An Excel dashboard generated by FormulaEngineer: a KPI band with revenue, cost and margin above a performance table with data bars and colour-coded status.

Generated in C#. No Excel, no COM, no template file.
29 live formulas · 18 format rules · 25 merged ranges · 36 styles from 9 fonts · 13.7 KB


↓ Download this workbook


1. Introduction

FormulaEngineer is a complete .NET Excel solution for creating, reading, recalculating, and professionally styling .xlsx workbooks.

Most .NET spreadsheet libraries can open and create Excel files. Very few can accurately evaluate the formulas inside them.

FormulaEngineer was built around that gap.

It parses Excel formulas, resolves workbook references and dependencies, applies Excel-style type coercion and error behavior, and calculates fresh results in pure managed .NET—without starting Excel or relying on COM automation.

Since version 3.0, FormulaEngineer also provides a comprehensive workbook-presentation API for producing polished reports, financial models, exports, and dashboards.

Why recalculation matters

An .xlsx workbook may contain formula results previously saved by Excel. These cached values can be missing, stale, or incorrect after an application changes the workbook inputs.

FormulaEngineer evaluates the workbook logic directly.

Cached value stored in file
            │
            ├── Input changes
            │
            ▼
Cached result may now be stale
            │
            ▼
FormulaEngineer recalculates the formula
            │
            ▼
Fresh calculated result

Reading a cached value is not the same as recalculating a formula.


2. Why FormulaEngineer?

Real formula evaluation

FormulaEngineer does not merely read the last result saved inside an .xlsx file. It reads and evaluates the formula itself.

461 Excel-compatible functions

FormulaEngineer supports modern and classic Excel functions across lookup, financial, statistical, engineering, text, date/time, logical, database, dynamic-array, and lambda-helper families.

Excel-style workbook behavior

Formula evaluation includes references, ranges, structured tables, spilled arrays, type coercion, dependency resolution, and Excel error propagation.

High-performance streaming I/O

The forward-only reader and writer are designed for predictable memory usage, from small business reports to large server-generated exports.

Complete workbook presentation

Create workbooks that people can open and use immediately—with styling, conditional formatting, tables, comments, images, shapes, charts, sparklines, and auto-fit.

Cross-platform and server-ready

Run FormulaEngineer in ASP.NET Core, background services, Docker containers, CI/CD pipelines, Azure Functions, AWS Lambda, Windows, Linux, and macOS.


3. Key capabilities

  • Accurate formula evaluation — verified against hundreds of real-world formulas and workbook scenarios.
  • 461 Excel-compatible functions — across all major business and technical formula families.
  • Modern dynamic arrays — including FILTER, SORT, SORTBY, UNIQUE, SEQUENCE, TAKE, DROP, HSTACK, and VSTACK.
  • Lambda helpers — including LET, LAMBDA, MAP, REDUCE, SCAN, BYROW, BYCOL, MAKEARRAY, and ISOMITTED.
  • Advanced lookup behavior — including XLOOKUP, XMATCH, VLOOKUP, HLOOKUP, INDEX, MATCH, approximate matching, wildcard matching, and reverse search.
  • Structured table references — including row-level calculated-column formulas.
  • Cross-sheet evaluation — formulas can reference values and ranges on other worksheets.
  • Dynamic-array spilling — with Excel-style broadcasting, spill references, #SPILL!, and #CALC! behavior.
  • Excel-style errors — errors such as #N/A, #VALUE!, #REF!, #NUM!, and #DIV/0! are preserved as calculation results.
  • Circular-reference detection — circular dependencies are detected instead of causing uncontrolled recursion.
  • Formula reading and writing — write formulas into cells, reopen the workbook, and evaluate them without Excel.
  • Streaming workbook I/O — forward-only reading and writing with a flat memory profile.
  • Professional styling — fonts, fills, borders, number formats, alignment, protection, merged cells, row heights, column widths, and auto-fit.
  • Advanced workbook objects — conditional formatting, rich text, named styles, themes, tables, notes, threaded comments, images, shapes, charts, and sparklines.
  • Cross-platform deployment — pure managed code targeting .NET 6 and later.

4. Package summary

Property Details
Package FormulaEngineer
Current version 3.0.4
Target framework net6.0
Compatible runtimes .NET 6 and later
Supported platforms Windows, Linux, macOS
Excel installation required No
COM interop required No
Workbook format Excel .xlsx / OOXML
Excel-compatible functions 461
Formula support Read, write, and recalculate
Workbook I/O High-performance streaming reader and writer
Presentation support Styling, tables, comments, images, shapes, charts, and sparklines
Licence Commercial with a 30-day free trial
Distribution NuGet

5. Function coverage

FormulaEngineer supports 461 Excel-compatible functions and special forms across the major Excel formula families.

Family Count Coverage
Statistical 134 Aggregation, distributions, forecasting, regression, correlation, covariance, ranking, hypothesis testing, and legacy compatibility
Math and Trigonometry 72 Arithmetic, rounding, powers, factorials, combinatorics, trigonometry, hyperbolic functions, matrices, and random values
Engineering 50 Unit conversion, base conversion, bitwise operations, error functions, step functions, and complex numbers
Financial 45 Loans, investments, depreciation, securities, yields, cash flows, and rates
Text 42 Concatenation, searching, replacement, case conversion, parsing, splitting, and value-to-text conversion
Date and Time 25 Serial dates, business days, ISO weeks, date arithmetic, and month-end calculations
Lookup and Reference 20 Lookups, references, spill anchoring, range trimming, and address operations
Logical 20 Conditions, boolean logic, error handling, named values, custom functions, and lambda helpers
Information 20 Type checks, cell metadata, error inspection, and worksheet information
Dynamic Array 18 Generating, reshaping, filtering, sorting, stacking, wrapping, and transforming spilled arrays
Database 12 Criteria-based aggregation over structured data
Published total 461 Named functions and supported parser-level special forms

Popular supported functions

SUM · SUMIF · SUMIFS · COUNTIF · COUNTIFS · AVERAGEIFS

XLOOKUP · VLOOKUP · HLOOKUP · INDEX · MATCH · XMATCH

FILTER · SORT · SORTBY · UNIQUE · SEQUENCE · TAKE

PMT · PV · FV · NPV · IRR · XNPV · XIRR

DATE · EDATE · EOMONTH · WORKDAY · NETWORKDAYS

FORECAST.LINEAR · PERCENTILE.INC · STDEV.S · CORREL

LET · LAMBDA · MAP · REDUCE · SCAN · BYROW · BYCOL

Browse all 461 supported functions →


6. Excel-style formula behavior

Formula evaluation involves much more than parsing a formula string.

FormulaEngineer handles:

  • Cell and range references
  • Relative and absolute references
  • Cross-sheet references
  • Named references
  • Structured table references
  • Dependent formula cells
  • Numbers, text, dates, booleans, and blanks
  • Array broadcasting
  • Horizontal and vertical spilled arrays
  • Lookup matching and search modes
  • Excel serial-date calculations
  • Excel-style type coercion
  • Formula error propagation
  • Circular-reference detection

Formula results can include:

Result type Examples
Numbers Integers, decimals, percentages, and financial results
Text Concatenation, lookup output, and formatted values
Dates and times Excel serial dates and time values
Booleans TRUE and FALSE
Blank values Empty formula results
Spilled arrays Horizontal and vertical dynamic arrays
Excel errors #N/A, #VALUE!, #REF!, #NUM!, #SPILL!, #CALC!, and #DIV/0!

Excel errors are calculation results—not application crashes.


7. Validation

FormulaEngineer is validated with workbook-style scenarios—not only isolated parser tests.

Validation covers:

  • Surrounding worksheet data
  • Dependent formula cells
  • Cross-sheet references
  • Structured table references
  • Dynamic arrays and spilled results
  • Lookup formulas
  • Date and time formulas
  • Text formulas
  • Financial formulas
  • Statistical formulas
  • Excel error values
  • Cached values versus recalculated values

Representative validation scenarios

Scenario Example formula Verified behavior
Multi-level dynamic sort =SORT(A2:C13,{2,3},{1,-1}) Sorts by category ascending and score descending
Unique two-level sort =SORT(UNIQUE(E2:F40,FALSE,FALSE),{2,1},{1,-1}) Produces sorted unique name/product rows
Case-sensitive lookup =INDEX(D2:D20,MATCH(TRUE,EXACT(H2,A2:A20),0)) Resolves the exact-case matching row
XLOOKUP with exact text =XLOOKUP(TRUE,EXACT(H2,A2:A20),D2:D20) Returns the value associated with the exact-case match
Closest-value lookup =INDEX(A2:A20,MATCH(MIN(ABS(C2:C20-H2)),ABS(C2:C20-H2),0)) Finds the row closest to a target value
Dynamic sequence =SEQUENCE(5,1,10,5) Produces 10, 15, 20, 25, 30
Sorted filtered results =SORT(FILTER(A2:B20,B2:B20>=LARGE(B2:B20,H2)),2,-1) Filters top records and sorts them descending
Structured reference =[@Price]*[@Quantity] Evaluates a calculated table-row formula
Excel error behavior =SEARCH(E2,A2) Returns #VALUE! when the text is absent
Error handling =IFERROR(SEARCH(E2,A2),"Not Found") Converts the error into the specified fallback

Test formula recalculation fairly

A fair formula-engine test should measure recalculation—not only cached-value reading.

  1. Open a real workbook containing formulas.
  2. Change one or more input cells.
  3. Ignore the cached formula results stored in the workbook.
  4. Recalculate the formulas.
  5. Compare the newly calculated results with Excel.

Review the complete validation methodology →


8. Installation

Install FormulaEngineer from NuGet:

dotnet add package FormulaEngineer

Or add the package directly to your project file:

<PackageReference Include="FormulaEngineer" Version="3.0.4" />

FormulaEngineer targets .NET 6 and works with later compatible .NET versions.

The 30-day trial starts automatically on first use. No activation code is required during the trial.


9. Quick start

Create a workbook containing a formula

Formula text passed to ExcelFormula.From(...) must not include a leading =.

using FormulaEngineer.Api;

using (var writer = new ExcelWriter("sum.xlsx"))
{
    using (var sheet = writer.CreateWorksheet("Data"))
    {
        sheet.WriteRow(10);                              // A1
        sheet.WriteRow(20);                              // A2
        sheet.WriteRow(30);                              // A3
        sheet.WriteRow(ExcelFormula.From("SUM(A1:A3)")); // A4
    }

    writer.Close();
}

Open the workbook and evaluate the formula

using FormulaEngineer.Api;

using var reader = new ExcelReader("sum.xlsx");
using var evaluator = new ExcelFormulaEvaluator();
using var sheet = reader.OpenWorksheet("Data");

var result = evaluator.EvaluateCell(
    sheet,
    row: 4,
    col: 1);

Console.WriteLine(result);

Output:

60

The result is calculated from SUM(A1:A3). It is not simply read from a previously stored cached value.


10. Real-world invoice example

Create an invoice containing calculated line totals, subtotal, tax, and final total:

using FormulaEngineer.Api;

using (var writer = new ExcelWriter("invoice.xlsx"))
{
    using (var sheet = writer.CreateWorksheet("Invoice"))
    {
        sheet.WriteRow(
            "Item",
            "Qty",
            "Unit Price",
            "Line Total");

        sheet.WriteRow(
            "Widget",
            4,
            25.00,
            ExcelFormula.From("B2*C2"));

        sheet.WriteRow(
            "Gadget",
            2,
            80.00,
            ExcelFormula.From("B3*C3"));

        sheet.WriteRow(
            "Subtotal",
            "",
            "",
            ExcelFormula.From("SUM(D2:D3)"));

        sheet.WriteRow(
            "Tax (8%)",
            "",
            "",
            ExcelFormula.From("D4*0.08"));

        sheet.WriteRow(
            "Total",
            "",
            "",
            ExcelFormula.From("D4+D5"));
    }

    writer.Close();
}

Reopen the workbook and calculate the final total:

using FormulaEngineer.Api;

using var reader = new ExcelReader("invoice.xlsx");
using var evaluator = new ExcelFormulaEvaluator();
using var sheet = reader.OpenWorksheet("Invoice");

var total = evaluator.EvaluateCell(
    sheet,
    row: 6,
    col: 4);

Console.WriteLine(total);

Output:

318.6

11. Professional workbook styling

FormulaEngineer produces workbooks that are ready to open, present, and share—not raw grids requiring manual formatting.

using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;

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 currencyStyle =
    ExcelStyle.Default.With(
        numberFormat:
            ExcelNumberFormatStyle.Custom("$#,##0.00"));

using (var writer =
       new ExcelStyledWriter("sales-report.xlsx"))
{
    using (var sheet =
           writer.CreateWorksheet("Sales"))
    {
        sheet.WriteRow(
            new object?[]
            {
                "Product",
                "Units",
                "Revenue"
            },
            headerStyle);

        sheet.WriteRow(
            new object?[]
            {
                "Formula Engine",
                12,
                5988m
            },
            new ExcelStyle?[]
            {
                null,
                null,
                currencyStyle
            });

        sheet.WriteRow(
            new object?[]
            {
                "Streaming Writer",
                8,
                2204m
            },
            new ExcelStyle?[]
            {
                null,
                null,
                currencyStyle
            });
    }

    writer.Close();
}

Styling and presentation capabilities

Capability Examples
Fonts Family, size, bold, italic, underline, and color
Fills Solid colors and theme-based fills
Borders Per-side styles, colors, and combinations
Number formats Currency, percentage, date, time, accounting, and custom formats
Alignment Horizontal, vertical, indentation, rotation, and wrapping
Layout Column widths, row heights, merged cells, and auto-fit
Conditional formatting Data bars, color scales, icon sets, and formula rules
Rich text Multiple formatted runs inside one cell
Tables Real Excel tables with styles and structured references
Notes and comments Traditional notes and threaded comments
Images and shapes Embedded images and worksheet drawing objects
Charts Workbook charts anchored to worksheet cells
Sparklines Compact in-cell trend visualizations
Dashboards KPIs, summary tables, charts, and conditional formatting

Explore the styling examples →


12. Streaming workbook processing

FormulaEngineer is designed for both compact business reports and high-volume data exports.

Its streaming reader and writer provide:

  • Forward-only workbook processing
  • Single-enumeration access
  • Predictable memory usage
  • A flat memory profile regardless of workbook size
  • No dependency on an installed Excel application
  • Styling and layout during workbook generation
  • Server-friendly processing for APIs and background jobs

Use FormulaEngineer for:

  • Financial reports
  • Invoice generation
  • Operational exports
  • Uploaded workbook processing
  • Formula-driven business rules
  • Automated workbook validation
  • Background recalculation jobs
  • Large server-side XLSX exports
  • Executive dashboards
  • CI/CD workbook testing

13. More than formula evaluation

Formula evaluation is FormulaEngineer's defining capability—but it is not the only one.

Area Capabilities
Core styling Fonts, fills, borders, number formats, alignment, and protection
Layout and auto-fit Column widths, row heights, merged cells, wrapped text, and streaming auto-fit
Conditional formatting Data bars, color scales, icon sets, and formula-driven rules
Rich text Multiple fonts, colors, and styles within one cell
Tables Real Excel tables with styles and structured references
Notes and comments Traditional notes and threaded comments
Images Embedded PNG and JPEG images
Shapes Worksheet drawing objects
Charts Professional charts connected to workbook data
Sparklines Line, column, and win/loss sparklines
Dashboards Attractive, formula-driven business dashboards

Advanced capabilities are opt-in so applications only enable the workbook features they need.


14. Deployment

FormulaEngineer can run anywhere compatible .NET applications run.

Supported application types

  • ASP.NET Core applications
  • REST APIs
  • Background services
  • Console applications
  • Windows services
  • Linux services
  • Docker containers
  • CI/CD pipelines
  • Azure Functions
  • AWS Lambda
  • Blazor applications
  • WinForms applications
  • WPF applications

No Excel installation, desktop session, Office process, or COM automation is required.


15. Examples and resources

Resource Description
Formula examples Create, read, and recalculate workbook formulas
Styling examples Build professionally formatted workbooks
CI/CD examples Use FormulaEngineer in automated environments
Supported functions Browse all 461 supported Excel functions
Formula validation Review real-workbook validation scenarios
Live demo Try formula evaluation in the browser
NuGet package Install the latest FormulaEngineer release
Pricing Review trial, solo, and team licence options

16. Licensing

FormulaEngineer is commercial software with a built-in 30-day free trial.

Free trial

  • Full access to FormulaEngineer features
  • No licence activation required
  • Starts automatically on first use
  • No credit card required
  • Available on Windows, Linux, and macOS
  • Intended for evaluation and testing

Paid licences

Paid solo and team licences include commercial use, updates, bug fixes, and support according to the selected plan.

Activate a paid .lic file before using the workbook APIs:

using FormulaEngineer.Licensing;

LicenseManager.ActivateFromFile("license.lic");

View current pricing and licence options →

Read the policies and licensing terms →

FormulaEngineer is licensed software, not open-source software. Access to this repository, its documentation, or its examples does not grant a licence to the proprietary FormulaEngineer package.


17. Contact

Need a function that is not yet supported? Want to check whether FormulaEngineer can process a specific workbook?

Send the function name, formula example, and a minimal sanitized workbook when possible.


Recalculate workbook logic. Generate polished Excel output. Keep Excel off the server.

FormulaEngineer — the complete .NET Excel solution.

Install from NuGet · Try the live demo · Explore examples

© 2026 FORMULAENGINEER TECHNOLOGIES (OPC) PRIVATE LIMITED. All rights reserved.

About

A complete .NET Excel solution for creating, reading, styling, and recalculating formulas in XLSX workbooks at runtime—without Excel or COM interop.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors