The Python was right. The spreadsheet was wrong.

On 400 spreadsheet tasks, the agent without an engine scored 78% and the agent with GRID scored 90.75%. When we required formulas where the reference workbook had formulas, the same workbooks scored 54.25% without an engine and 87% with GRID.

Steinn Eldjárn Sigurðarson27 November 2026 · 12 min read

We put a lot of effort into making our spreadsheet engine as good as it possibly can be, we test it on thousands and thousands of spreadsheets to make it load and calculate efficiently and identically to Excel. We spent the first 6 years as a company focusing in fairly equal measures on this, and building our own product interface on top of spreadsheets. In 2024 we realized that the real next generation spreadsheet software wouldn't be made for humans, or at least not humans alone.

The challenges of making an agent capable of working on spreadsheets are in many ways not dissimilar to allowing a human to work on spreadsheets. The agent needs to be able to see and explore the model and data, it needs to be able to run calculations and see the effects of its changes, and it needs to understand the task at hand. In our work we thus categorize agentic spreadsheet capabilities into three categories:

  1. Discovery and orientation: Where is everything?
  2. Calculation and verification: How does this work? What happened?
  3. Understanding and semantics: What needs to be done and why?

The first two categories are the ones where GRID directly moves the needle, the third category is dominated by the underlying LLM model, but our skills, tools, and engine can help. In this article I'll be discussing how capability #2: Calculation and verification help an agent with real spreadsheet tasks, based on findings from our ongoing research and experimentation with our engine and agentic workflows.

Calculation and verification

Believe it or not but spreadsheets existed way before there was spreadsheet software. The term originates in accounting and referred to wide sheets of paper ruled with grids to form columns and rows, across which accountants would manually write and calculate long numerical series. This must have been a fairly time consuming, tedious job. VisiCalc hit the market in 1979, and as an early VisiCalc advertisement put it:

“As quickly as you type it in, VisiCalc calculates and displays the results.”

These old manually written and calculated spreadsheets are now the stuff of museums. Nobody works on spreadsheets without software handling the calculations.

Of course LLM's are incredibly powerful contraptions, unaffected by tedium and will gladly read, reason about, and write numbers all day long. Give them access to programming runtime like python and they'll easily generate code to calculate and work with your numbers in a pretty reliable way too! But if the task at hand is to work on a spreadsheet, without a spreadsheet engine, there's a pretty good chance that your spreadsheet will contain one or more of the following:

  • Formulas producing different values than the ones the agent saw in python
  • Hardcoded numbers where the spreadsheet should have a model of formulas and references
  • Completely broken formulas (#NAME?, #NUM!, #DIV/0! ...)

There's only one solution to this problem: Give the agent a spreadsheet engine. Here’s how ours compares to Excel.

The experiment: Qwen3.8-27b with and without a spreadsheet engine

We gave the same 400 SpreadsheetBench Verified tasks[1] to two agents using this model:

Without an engine

Python and openpyxl to read and write the workbook. The agent can calculate answers in Python, but cannot evaluate the spreadsheet formulas it saves.

With GRID

Our tools, skills and prompts around the GRID engine. The agent can inspect the workbook, evaluate candidate formulas and check calculated results as it works.

Our tests with Claude Sonnet 5 showed that an engine helped, and we wanted to see whether open weight models would benefit proportionally more. In this experiment we also looked at what the agents had left in the workbooks: how often was the right answer just a number typed into a cell?

We chose Qwen3.8-27b: a model small enough for an enterprise to run locally and adapt to its own tasks, with open weights and tools for fine-tuning.[2] Companies are already fine-tuning members of the Qwen family for production use.[3]

Where the agent struggles without an engine

To demonstrate how an agent benefits from an engine we thought the best way would be to show some concrete examples.

We went back to the tasks where the agents' results differed, repeated them with and without an engine, and read the transcripts. This let us distinguish recurring problems from one-off misses—and cases where the no-engine agent got the numbers right by leaving out the formulas.

PassWrongHardcoded

TaskNo engineGRID
Initial1stRepeatsInitial1stRepeats
The featured tasks: one initial attempt and five repeats per agent. “Hardcoded” means the values were correct, but required formulas were missing. These repeats informed the examples; they are not the full-set scores below.
About the attempts

The initial attempt comes from the full-set comparison. We then ran each featured task five more times with each agent. A pass means the answer matched the reference and the required formulas were present.

GRID-agent’s tools, prompts and skills evolved between repeats, so approaches may differ across transcripts. We left versions unpinned: the question was the value of engine access, not which GRID-agent configuration worked best.

Below you can find all eight examples and the solutions from both agents.

Example 1 of 8

‹ PreviousNext: Attendance ›

The golf coach's last four rounds

A high school golf coach is tracking his players' performance in a spreadsheet. He already has the season average for each player, but wants to see how their last four scores average in comparison. Players don't show up to every tournament, so the rows have gaps, and the coach needs help. While easy to do by eye (skip the blanks, count four back from the right), this is surprisingly fiddly to put into a formula, because the range you need isn't the same for every player.

The coach's spreadsheet, with the season averages already calculated in column P. The agents should enter their formulas into .

Both agents correctly worked out what the answers should be, but getting from there to a working spreadsheet formula proved more difficult. Both tried using LARGE to pick out the four scores to average. This function picks the largest values in a range, so for the first golfer it gives an average of 86, whereas the last four scores average 83.25. Let's look at how each agent dealt with this.

Without an engine

  1. turns 1–2The agent uses Python to average each player's last four scores, skipping the blanks. It gets all four right: 83.25, 84.25, 86.75 and 78.75. While considering how to do this in a spreadsheet formula, it decides to use LARGE, but seems to spot a problem: "it only ranks values, not dates."
  2. turn 3Writes the LARGE formula into Q2:Q5 and saves: "since scores are recorded chronologically, the four largest-index entries are the last four played rounds". It seems convinced that LARGE returns the k largest indexes from a set, not the largest values.
    =AVERAGE(LARGE(B2:N2,1),LARGE(B2:N2,2),
      LARGE(B2:N2,3),LARGE(B2:N2,4))   → 86
  3. turns 4–5For a final check, the agent opens the saved file and calculates the averages again in Python. It gets the same four answers and declares the work verified. It is hoping that LARGE works the way it thinks it does, but the results don't line up: the formulas it saved give 86, 84.5, 86.75 and 83.75 when calculated. Only one of the four is right.

The agent's own reasoning suggests uncertainty about LARGE being the right function, but it decides to use it anyway. It checks its work the only way it can and calculates the averages again in Python, but those calculations don't validate the approach. It finishes by confidently reporting the correct averages and the formula which produces wrong results for three out of four cases.

With GRID

  1. turns 1–8After exploring the sheet, the agent works out the four expected averages: 83.25, 84.25, 86.75 and 78.75. It plans to try its formulas on the players' rows and check that they produce these numbers before putting them in the sheet.
  2. turn 9The agent makes exactly the same mistake with LARGE, which makes sense: it's the same model. But here it uses the engine to calculate the formula for each player.
    =AVERAGE(LARGE(B2:N2,{1,2,3,4}))   → 86
    =AVERAGE(LARGE(B3:N3,{1,2,3,4}))   → 84.5
    =AVERAGE(LARGE(B4:N4,{1,2,3,4}))   → 86.75
    =AVERAGE(LARGE(B5:N5,{1,2,3,4}))   → 83.75

    The first result is 86, where it expected 83.25. Seeing the results, the agent recognizes the problem: LARGE picks the highest values, not the last, in the set. This agent is able to change course because of the engine.

  3. turns 10–17Getting the formula right still takes a few attempts. Some give the wrong averages, others produce errors. The agent tries the pieces separately and eventually puts together a formula that skips the blanks and picks out the last four scores. Tested on all four players, it returns 83.25, 84.25, 86.75 and 78.75, exactly as expected.
    =AVERAGE(
      INDEX(FILTER($B2:$N2,$B2:$N2<>""),COUNT($B2:$N2)),
      INDEX(FILTER($B2:$N2,$B2:$N2<>""),COUNT($B2:$N2)-1),
      INDEX(FILTER($B2:$N2,$B2:$N2<>""),COUNT($B2:$N2)-2),
      INDEX(FILTER($B2:$N2,$B2:$N2<>""),COUNT($B2:$N2)-3)
    )   → 83.25

    FILTER removes the blanks without changing the order of the scores. COUNT tells the formula how many scores there are, and the four INDEX calls count back from the last one.

  4. turns 18–23The agent puts the working formulas into Q2:Q5, then reads back the calculated values from those cells. All four match the expected averages, and a check of the sheet finds no formula errors.

With GRID, the agent can try its formula and see what it actually calculates. When LARGE returns 86 for the first golfer, it has a result to compare with the 83.25 it already worked out, and recognizes why the formula is wrong. It still has to work through several attempts to get a formula that handles the gaps correctly, but it can calculate and check each one as it goes. By the time it finishes, it has read back the results from the cells it changed and confirmed that all four match the expected averages.

The workbooks turned in by the agents

The agent without an engine understood the task. In Python, it skipped the blanks and averaged the last four scores correctly. But the formula it saved averaged the four highest scores, not the four most recent ones.

The formula produced with GRID works for this sheet, but is unnecessarily complicated and fails with only one or two scores. A simpler version handles those cases too:

=AVERAGE(TAKE(FILTER($B2:$N2,$B2:$N2<>""),,-4))

The workbooks in these examples come from SpreadsheetBench[1] and are shared under CC BY-SA 4.0; author names in the files' properties have been redacted.

What the benchmark score misses

For the full-set comparison, we recalculated both agents' output workbooks before comparing the requested cells with the reference answers. GRID passed 363 tasks to the no-engine agent's 312: 62 tasks only GRID solved, offset by 11 only the no-engine agent solved.

The benchmark’s value check accepts a hardcoded answer just as readily as a formula. In 95 of the 312 workbooks that passed without an engine, the agent had left numbers where formulas were expected. With GRID, that happened in 15 of the 363 that passed.

Pass with required formulasAdditional value-only pass

0%25%50%75%100%

No engine

78% by value

54.25%

217 retained · 95 missing formulas · 312 value passes

GRID

90.75% by value

87%

348 retained · 15 missing formulas · 363 value passes

When the reference answer used a formula, we checked that the agent used one in the same cell, except for three cases where the instructions arguably requested values.

Requiring formulas changes the comparison from 78% versus 90.75% to 54.25% versus 87%. The gap grows from 12.75 to 32.75 percentage points.

It’s worth noting that under the benchmark’s standard scoring, Qwen with GRID matched the median of our seven Sonnet 5 runs. Its score of 90.75% was just half a percentage point below the best. That’s an impressive result for a 27B open-weights model.

Why the formula matters

The agent without an engine could calculate in Python; the GRID agent had our agent tools for working with the workbook, and our GRID-agent library extends those with more skills and provides direct scripting access to the engine. That meant it could put a formula in the workbook and see what it actually calculated before handing it back.

A spreadsheet with calculated but hardcoded values is an oxymoron. The user changes an input, but the answer stays the same. There is no formula to inspect or repair: the user has to reconstruct the calculation or send the job back to the agent. That assumes they notice the problem before using the spreadsheet to make a costly decision.

A similar gap shows up in the Tafla benchmark. With a JavaScript sandbox but no calculation engine, the agent got both answers right in 283 of 285 sessions. In only 227 of those sessions did its formulas also reproduce every number on the board.

An engine can show what a formula calculates; it cannot decide whether that’s what the task requires. This is the first article in our series on making a capable spreadsheet agent. We started with calculation and verification. In the next parts we’ll look at discovery and orientation (where is everything?) and understanding and semantics (what needs to be done and why?).

References

  1. [1]

    Ma et al. (2024). SpreadsheetBench. Verified 400 dataset. ↩ 1↩ 2

  2. [2]

    Qwen3.8-27B model card. Unsloth: local setup and fine-tuning. ↩

  3. [3]

    Production fine-tuning: Pallet's production model; Shopify's Flow agent; Baseten and Genspark's research model. ↩

The VisiCalc advertisement appeared in Creative Computing, February 1981. Dan Bricklin, who created VisiCalc with Bob Frankston, is an advisor to GRID.

News

Updates and announcements

19.11.2026

How AI builds a spreadsheet: openpyxl, then 430 MB of LibreOffice

In September, Simon Willison went poking around his disk and found 1.7 GB of runtime inside OpenAI's Codex desktop app, since renamed ChatGPT. Next to Python, Node and git sat a complete headless LibreOffice: 430 MB of office suite, shipped so the agent can work with documents. This did not surprise us. We have watched this pipeline since the first AI spreadsheet experiments, and it is still how most of the industry builds spreadsheets with AI. It made sense as a stopgap. It doesn't anymore: next to an engine built for the job, it is less accurate, far slower and more than a hundred times bigger. The recipe Ask an AI agent for an Excel model and it will almost always write the file with openpyxl, the Python library all over its training data. openpyxl writes formulas but cannot calculate them, so the formula cells hold no values. Anything that reads the stored values sees blanks: the Python data library pandas, file previews, and the agent itself, checking its own work. And the model writes formulas the way a person types them, not the way Excel stores them. Leave out the _xlfn. prefix Excel expects on XLOOKUP inside the file and the cell opens in Excel as #NAME?. Write a LET without its _xlpm. prefixes, or a spill reference like A1#, and Excel greets the whole file with "We found a problem with some content". So the pipeline needs something to calculate the file, and the answer is nearly always LibreOffice. Anthropic's public xlsx skill runs LibreOffice to recalculate the workbook. Alibaba's QwenPaw agent ships an adapted copy of the same script. Moonshot's Kimi checks its files against LibreOffice's recalculation, according to an extracted copy of its skills. OpenAI bundles the whole suite into its desktop app. LibreOffice is free, it is already there, and it opens xlsx. None of that means it calculates like Excel. So how close does it get? Missing one case in eight Last week we published the GRID Spreadsheet Benchmark: over 100,000 test cases from eight open source test suites, 13 engines, every case checked against Excel itself. LibreOffice matches Excel on 87.4% of them. That sounds respectable, and LibreOffice Calc is a good spreadsheet app. The test is deliberately hard: it is built from edge cases, not the SUMs that fill most of a real model. But edge cases are where a model goes quietly wrong, matching Excel on them is a high bar, and the last few percent are where the hard work is. 87.4% is 126 misses in every 1,000 cases. The GRID engine gets 1.2 wrong. LibreOffice isn't sloppy. It is a different spreadsheet app with its own opinions. On its own project's test suite it agrees with Excel only about 84% of the time, because many of those tests expect LibreOffice's answer: it converts units Excel has never heard of, and it finds interest rates where Excel gives up with #NUM!. Of the nearly 500 Excel functions in the benchmark, only 16 pass every test in LibreOffice. In GRID, 439 do. Then the tool starts dictating the spreadsheet. Anthropic's skill tells the model to never use XLOOKUP, XMATCH, SORT, FILTER, UNIQUE or SEQUENCE, saying the LibreOffice it runs can't evaluate them. LibreOffice has handled them since 2024, but the rule stands: the agent builds an older, worse spreadsheet to suit its calculator. "We found a problem with some content" In most of these pipelines, when LibreOffice recalculates a file, it also saves it, and it saves it the way LibreOffice understands it. Usually the file still opens in Excel. Sometimes it doesn't. Take the sensitivity table, a fixture of every financial model: a what-if data table showing, say, the implied share price under different WACC and terminal growth assumptions. Put a workbook with one through a pipeline that saves through LibreOffice, like QwenPaw's, open it in Excel, and you get "We found a problem with some content". LibreOffice has written the table back as a formula Excel doesn't have. Click Yes, and Excel repairs the file by turning every cell of the table into a fixed number. The numbers are right for today's inputs. Change the WACC and nothing moves. The model still looks finished. It just stopped being a model. Anthropic's skill was recently changed to recalculate on a copy and write only the values back into the file. That is a sensible patch, and an admission that LibreOffice can't be trusted to save the file. It is still trusted to calculate it, and to tell the agent the file is fine. That trust is misplaced too, because LibreOffice waves through problems it didn't cause. Ask an agent for a table with years as column headings, 2025 and 2026, as in nearly every financial model. openpyxl writes the headings as numbers, and Excel requires table headings to be text. Name a table Q1 and it is the same story, since Excel reads that as a cell address. LibreOffice opens these files, recalculates them without complaint and saves them. The agent's check passes. Excel opens the file with "We found a problem with some content". 430 MB and a second and a half Even when it gets the answer right, LibreOffice is the wrong shape for the job. Every check boots a desktop office suite in headless mode, loads the file, calculates, and writes the file back. On nearly 1,800 benchmark workbooks, run on the same machine, that took a median of 1.6 seconds per workbook. The GRID engine took 18 milliseconds, and it doesn't need to save: it holds the workbook in memory and writes the file once, when the agent is done. These are small workbooks, so most of that time is LibreOffice starting up, and today's agent skills pay it on every check. Anthropic's starts it twice. The obvious fix is to keep it running. In a separate test it still took about 80 milliseconds per workbook, and now the client keeps an office suite running in the background whenever a spreadsheet might come up in any thread. Then there is the weight. ChatGPT's headless LibreOffice is 430 MB. The GRID engine is a 3.5 MB package that runs in process, in Node or in the browser. The embedded LibreOffice may actually be doing other jobs too, like rendering documents and converting them to PDF. But those jobs have lighter tools as well. SuperDoc builds, edits and renders Word documents in the browser: an engine for DOCX, the way GRID's is for XLSX. A couple of small JavaScript libraries turn DOCX into PDF without a desktop suite. However you slice it, 430 MB of LibreOffice in a client is a kludge. Calculate it right AI is about to write more spreadsheets than people ever did. Those files will be opened in Excel, sent to clients and used for decisions, and Excel is where the numbers are checked. If an agent's model shows one figure and the same file shows another in Excel, the user doesn't conclude that LibreOffice and Excel differ on a corner case. They conclude the AI got it wrong. They start rechecking every number, and they stop trusting the next model before they open it. One wrong cell is enough to spend the trust that was supposed to save them the work. The GRID engine calculates the way Excel does, in milliseconds, without an office suite attached. The benchmark and its harness are open, so check the numbers. If you build agents that write spreadsheets, talk to us.

13.11.2026

Why you shouldn't vibe code a spreadsheet engine

Some of what Excel does is just weird. And unless you've spent years building a spreadsheet engine, you probably have no idea just how weird.

10.11.2026

The GRID Spreadsheet Benchmark: how close do spreadsheet engines get to Excel?

Every spreadsheet solution will say it is compatible with Excel. Now we can check those claims. For eight years our job at GRID has been to build a spreadsheet engine that gives the same answer as Excel, because if a model returns different numbers nobody will trust your solution. To make sure we'd earn that trust, we had to build a test rig. Today we are opening that rig up. The GRID Spreadsheet Benchmark measures how closely an engine's formula results match Excel's. It runs thirteen engines today, the results are live on the benchmark page, and everything needed to rerun it is in a public repository. If you are choosing an engine to build on, or building one yourself, this is meant for you.

Visit our blog

Spreadsheets run the world

We run spreadsheets

2026 GRID

Developers

Get startedDocumentationLicensingGRID Labs

About us

CompanyCareersBlogContact us

Legal

SecurityPrivacy Policy
Press kit
Press kit

2026 GRID