ExcelCannon

Fire an Excel workbook in — get a canonical, deterministic, LLM-ready model out. Then diff, score, and lint filled templates against it.

extractrenderdifflint

From spreadsheet to canonical model

One command reads the whole workbook — cells, formulas, styles, dropdowns, merged headers, named ranges, VBA — and writes one canonical form: JSON for machines, compact text for inference.

book.xlsx — what Excel shows

ABCD
1RegionQ1Q2Total
2North100120=SUM(B2:C2)
3South9080=SUM(B3:C3)
4Approved?Yes

bold = header row  ·  green = input cells (validation/dropdown)  ·  blue = formulas

excelcannon
extract

canonical model — what your LLM reads

== SHEET Sales | A1:D4 | frozen r1
-- headers A1:D1 [table,style] A=Region B=Q1 C=Q2 D=Total
-- grid A1:D3
r1: Region | Q1 | Q2 | Total
r2: North | 100 | 120 | =SUM(B2:C2)
r3: South | 90 | 80 | =SUM(B3:C3)
-- fills D2:D3 = SUM(RC[-2]:RC[-1])
-- validation B4 list("Yes,No") dropdown
-- inputs Approved?: B4 [list] filled
-- deps D2:D3 <- B2:C3

Deterministic: the same workbook always produces byte-identical output. Sparse and compressed: a formula filled down a column is one line, not a thousand. Semantic: headers, inputs, computed cells, and dependencies are called out explicitly — the model explains how the workbook functions, not just what's in it.

Benchmark filled templates

Diff two workbooks — or a blank template against a populated one — and get category percentages plus an input-surface completion score. Built for measuring how well a template was filled.

values
90.9%
formulas
100%
structure
100%
format
100%
inputs filled
29 / 32
$ excelcannon diff expected.xlsx produced.xlsx
Sales!B3: value differs (90 -> 250)
Sales!D5: formula overwritten with literal
Overall match: 96.4%  ·  exit code 1

What it captures

Every cell, sparsely

Values, formulas (A1 + R1C1), merged ranges, styles deduped to semantic properties.

Template semantics

Headers, input surface with labels and constraints, dropdowns and validations, dependency summaries.

Tables & formatting

Excel tables, conditional formats, frozen panes, hidden sheets, named ranges.

VBA source

Full macro module source extracted from .xlsm — diffable like everything else.

Lint rules

Broken refs, validation violations, overwritten formulas, error values — CI-ready exit codes.

Rust fast

A 57-workbook, 397k-cell corpus extracts in ~0.6 s total. Deterministic every time.

Install

dotnet tool install -g RDLL.excelcannon

excelcannon extract book.xlsx --data --out model.json --text model.txt
excelcannon diff expected.xlsx produced.xlsx --json report.json
excelcannon lint filled.xlsx --strict

Ships as a .NET tool wrapping a native Rust binary. Windows, Linux, macOS.