Python library

Evaluate Excel formulas in Python

Python can read xlsx files a dozen ways — and calculate them almost none. openpyxl stores formula text without evaluating it. data_only=Truereplays whatever Excel last cached. The pure-Python evaluators cover a fraction of Excel's function surface and slow down on real models.

Formualizer is a spreadsheet engine written in Rust with first-class Python bindings: 400+ Excel-compatible functions, an incremental dependency graph, and Arrow-backed columnar storage. pip install formualizer — no Excel, no LibreOffice, no JVM.

pip install formualizer

Evaluate an existing workbook

import formualizer as fzwb = fz.load_workbook("model.xlsx")value = wb.evaluate_cell("Sheet1", 1, 2)   # row 1, col 2 (B1), 1-basedprint(value)                                # native float/str/bool — not a formula string

Results come back as native Python values: float, str, bool, None, or nested lists for spilled arrays. Errors are values too — a #DIV/0! returns {'type': 'Error', 'kind': 'Div'}instead of raising, so a single bad cell doesn't abort a batch evaluation.

Build and calculate a workbook from scratch

import formualizer as fzwb = fz.Workbook()s = wb.sheet("Sheet1")s.set_value(1, 1, 1000.0)s.set_value(2, 1, 2000.0)s.set_value(3, 1, 1500.0)s.set_formula(1, 2, "=SUM(A1:A3)")print(wb.evaluate_cell("Sheet1", 1, 2))   # 4500.0

Batch APIs (set_values_batch, set_formulas_batch, evaluate_cells, evaluate_all) cover the write-many/read-many shapes, and to_xlsx_bytes() round-trips the result.

Write calculated values back into the file

Downstream tools that read Excel's cached values — including openpyxl's own data_only=True — see real numbers after a recalculation pass:

import formualizer as fzsummary = fz.recalculate_file("model.xlsx", output="model.recalc.xlsx")print(summary["status"], summary["evaluated"], summary["errors"])

How it compares

formualizerformulaspycelxlcalculatoropenpyxl
Evaluates formulasyes — 400+ functionspartialpartialpartialno
CoreRust (native wheels)pure Pythonpure Pythonpure Pythonpure Python
Incremental recalc (dependency graph)yesgraph, full recompute focusper-target compilemodel compile
Deterministic evaluation (seed/clock)yesnonono
Errors as valuesyesvariesvariesvaries

Where it runs

Prebuilt wheels for CPython 3.10–3.13 on Linux, macOS, and Windows — plus a Pyodide-tagged wheel, so the same API runs in the browser. CI, containers, serverless: no office suite to install or babysit.

FAQ

Can Python evaluate Excel formulas without Excel installed?

Yes. Formualizer is a self-contained Rust engine with Python bindings — pip install formualizer, load the workbook, call evaluate_cell. No Excel, LibreOffice, or COM automation involved.

How is this different from openpyxl?

openpyxl reads and writes the xlsx file format, including formula text, but has no calculation engine. Formualizer evaluates the formulas. They compose: author with openpyxl if you like, calculate with formualizer — see the full recipe.

What happens on a formula error like #DIV/0!?

You get an error value ({'type': 'Error', 'kind': 'Div'}), not an exception. Check the return value to branch on errors; the rest of the workbook keeps evaluating.

Which Excel functions are supported?

400+ built-ins across math, lookup (VLOOKUP/XLOOKUP/INDEX/MATCH), text, date/time, financial, statistical, and dynamic arrays. See the function reference for the full list.

Is it fast enough for large workbooks?

The engine stores data in Arrow columns and vectorizes aggregate-heavy calculations (SUM/SUMIFS over large ranges); recalculation is incremental, so edits recompute only the dirty subgraph.

Start calculating

Install the wheel and evaluate your first workbook in minutes, or explore how the parser and function registry work.