Product details checked on November 12, 2026 against each vendor's own pages; Univer details against version 1.4.0.
Short answer: if an analyst is working in Excel, use an Excel add-in that edits through Excel itself (Microsoft Copilot in Excel, Claude for Excel or ChatGPT for Excel). If your team is building its own agent product, give the agent a spreadsheet engine it drives through an API, such as Univer or GRID. Univer has an open-source Apache-2.0 core, 500+ Excel functions and dependency-tracked recalculation, and runs headless in Node.js; GRID is a commercial engine that ships ready-made agent tools. Either way, every edit goes through a calculation engine and its dependency graph instead of through raw cell coordinates.
Why agents break formulas
An agent breaks a model when it changes the file without a calculation engine behind the edit. Four things usually go wrong:
- It writes a value over a formula. Setting a cell that held
=B4*0.6to6000deletes the formula. Totals still add up, but they stop following the inputs. - It inserts or deletes rows without rewriting references. Adding a row above revenue has to turn
=B4-B5into=B5-B6. Editing the file's XML, or using a library that only stores formula text, does not do this. - It cannot recalculate. File libraries such as ExcelJS and SheetJS Community Edition read and write formula strings but do not calculate them. ExcelJS's README says it "cannot process the formula to generate a result, it must be supplied." The agent cannot check the effect of its change until someone opens the file in Excel.
- It cannot see dependencies. Without a dependency graph, the agent does not know which outputs an input feeds, so it cannot check them after a change.
What "without breaking formulas" requires
Whichever tool you choose, check six things:
- Edits go through a calculation engine (Excel itself, or an engine that loads the workbook), not through text or XML.
- Inserting or deleting rows and columns rewrites every reference that crosses them.
- Dependent cells recalculate after each write, and the agent can wait for the result and read it back.
- Before writing, the agent can tell input cells from formula cells and can ask what depends on a cell.
- Changes land in a draft or a copy that a person reviews, with formulas visible, before they replace the model.
- The exported .xlsx still holds the formulas, not just their values, and opens cleanly in Excel.
Two kinds of tools
| Tool | Who it fits | Where the agent works | How edits keep formulas intact | XLSX | Price and license | Notable limits |
|---|---|---|---|---|---|---|
| Microsoft Copilot in Excel (edit mode) | An analyst working in Excel | Inside Excel on Windows, Mac and the web | Edits with Excel's own features (tables, PivotTables, formulas); plan mode shows the plan before any change | Native Excel | Microsoft 365 Personal or Family with an AI credits plan, or an eligible business or enterprise subscription | Editing requires Calculation Options set to Automatic |
| Claude for Excel | An analyst working in Excel | Excel add-in for the web, Windows (Microsoft 365) and Mac | Adjusts assumptions "while keeping formula relationships intact"; answers cite cells | Native Excel | Claude Pro, Max, Team or Enterprise | Data tables, macros and VBA unsupported; not on iPad or Android |
| ChatGPT for Excel | An analyst working in Excel or Google Sheets | Sidebar in Excel and Google Sheets; Codex in the ChatGPT desktop app can work with an open workbook | Edits the workbook in place, inside Excel | Native Excel | Free and Go (limited use), Plus, Pro, Business, Enterprise, Edu, K-12 | VBA and macros "may not be fully supported" |
| Univer | A team building its own agent product or embedding a spreadsheet | Your application, in the browser or headless in Node.js; Univer CLI for coding agents | Univer's formula engine: API writes recalculate dependents; dependency-query APIs; Worktree drafts for human review | Through Univer's commercial file conversion; free Freemium tier for evaluation | Core is Apache-2.0; Business license from $99 a month | No built-in Goal Seek or data tables; .xlsx conversion is not in the open-source packages |
| GRID | A team building its own agent product | Your application, in the browser, Node.js, Deno or Bun | GRID engine with dependency-graph recalculation; 27 agent tools over MCP or an agent SDK | Engine loads and saves .xlsx | Free evaluation license; commercial license priced per use case | Charts still in development; pivot tables partly supported |
All three add-in vendors tell users to review the agent's changes before relying on them.
Univer: an engine for teams building agent products
Univer is an Office SDK for building spreadsheet, document and slide editing into your own product. Its core, including the formula engine, is open source under Apache-2.0. The Server SDK (collaboration and Office file conversion), the AI SDK and the advanced plugins are commercial.
The formula engine
- 500+ Excel-compatible functions in the open-source
@univerjs/engine-formulapackage. They include the functions financial models rely on: NPV, XNPV, IRR, XIRR, PMT, SUMIFS, XLOOKUP, INDEX and MATCH, OFFSET, INDIRECT, LET and LAMBDA, plus dynamic arrays such as SEQUENCE and FILTER, with #SPILL! checks. - Recalculation follows dependencies. API writes such as
range.setFormula()andrange.setValue()"mark formula data dirty and schedule calculation automatically." Calculation is asynchronous, so the agent waits foronCalculationResultApplied()before it reads results. - Dependency queries.
getRangeDependents()returns the formulas that depend on a range,getInRangeFormulas()the formulas inside a range,getCellDependencyTree()one cell's tree, andgetFormulaExpressTree()the parsed structure of a formula. There is no ready-made Watch Window or step-by-step evaluation panel; these are APIs. - Circular references. Iterative calculation is open source and off by default. Turn it on per workbook with
workbook.setCalculationSettings({ iterativeCalculation: true, maxIterations: 100, maxChange: 0.001 });workbook.getCircularReferences()then lists each circular group with its iteration count and convergence information. - Stale cached values.
initialFormulaComputingsets what happens on load:WHEN_EMPTY(the default) calculates only formula cells without a stored value, andFORCEDrecalculates everything. UseFORCEDwhen cached results in an imported file may be out of date. - Commercial additions. The Advanced Formula Engine (
@univerjs-pro/engine-formula) adds performance and functionality, plus cross-workbook references bound to stable document IDs. - Not supported: built-in Goal Seek, one- and two-variable data tables, and Scenario Manager. Links to external Excel workbooks calculate from their saved cached values and are not reloaded or refreshed.
A formula-safe edit from an agent tool looks like this:
// univerAPI comes from createUniver() in the browser or FUniver.newAPI(univer) in Node.js
const workbook = univerAPI.getActiveWorkbook();
const inputs = workbook.getSheetByName('Inputs');
if (!inputs) throw new Error('Inputs sheet not found');
const formula = univerAPI.getFormula();
// 1. Before writing: which formulas read the growth-rate cell C4?
const dependents = await formula.getRangeDependents([
{
unitId: workbook.getId(),
sheetId: inputs.getSheetId(),
range: { startRow: 3, endRow: 3, startColumn: 2, endColumn: 2 }, // C4, zero-based
},
]);
// 2. Write only to an input cell, never over a formula
if (inputs.getRange('C4').getFormula()) throw new Error('C4 holds a formula, not an input');
inputs.getRange('C4').setValue(0.12);
// 3. Wait for dependent cells to recalculate, then read the outputs back
await formula.onCalculationResultApplied();
Tested with the open-source 1.4.0 packages in Node.js: a small model had units in B2, price in B3, revenue =B2*B3 in B4, cost =B4*0.6 in B5 and profit =B4-B5 in B6. After insertRowBefore() added a row above revenue, the formulas became =B5*0.6 and =B5-B6. Changing units then recalculated revenue (50,000) and profit (20,000), and getRangeDependents() on the units cell returned the revenue formula.
How an agent edits through Univer
The agent does not patch cells blindly. It reads the workbook's structure first, writes through the engine's commands, and reads the result back. There are two ways in:
- Univer CLI (open source, Apache-2.0) is for coding agents such as Claude Code, Codex, OpenCode, OpenClaw, Hermes Agent, WorkBuddy and Kimi. Install the skill with
npx skills add dream-num/skills -s univer-cli -g(Node.js 24 or later). The agent imports an .xlsx, .xls, .xlsm, .csv or .tsv file and opens an isolated Worktree draft. It reads ranges withinspect, edits by running Univer API code withexecute, reads the stored values back, and returns a local Viewer link. In the Viewer, Sheet Compare has a Show formulas switch so a person can see formula changes before choosing merge, reopen or discard. The CLI exports .xlsx, .csv and .tsv, and bundles a runtime development license forlocalhost. Note:executeruns trusted JavaScript and is not a sandbox for untrusted code. - AI SDK (commercial) is for building your own product's agent CLI. It is a TypeScript SDK whose documented loop is:
inspectthe workbook and range, look up an API withapi findorapi showwhen needed,execute --mode writeto edit, theninspectagain to review. Paired with the Web SDK and Server SDK, the same Worktree draft opens in your web app for a person to review and merge.
XLSX import and export: what is open source and what is not
The open-source packages calculate formulas and save Univer's own JSON snapshot. They do not read or write .xlsx. XLSX conversion is Univer's file exchange, which is part of the commercial Server SDK: @univerjs-pro/exchange-node on Node.js, or @univerjs-pro/exchange-client and @univerjs-pro/sheets-exchange-client in the browser, backed by a conversion service.
- Freemium: $0, with a watermark, unlimited imports, 10 exports a month and 3 collaborative editing connections. It is meant for development and testing.
- Business: from $99 a month, or from $1,000 a year, with 5,000+ exports a month, for commercial production use.
- Formats: Sheets import .xls, .xlsx, .csv and .tsv (.xlsm too, through the Node.js exchange and the CLI) and export .xlsx, .csv and .tsv.
- Formulas through the round trip: on import, missing cached formula results are filled in; before export, formulas can be recalculated according to the policy you choose.
- Limits: Univer says it "aims to preserve the content and layout of XLSX" files and that "unsupported elements may be dropped during conversion." Complex charts, external links and special objects have format-specific limits. VBA, XLSB and ODS are not supported, and there is no legacy .xls export. Test your own models at office.univer.ai/exchange before you commit.
Running headless in Node.js
Headless Univer is the same content models, commands, calculation and APIs as the browser editor, without the UI. The open-source install is:
npm install @univerjs/core @univerjs/engine-render @univerjs/engine-formula @univerjs/docs @univerjs/sheets @univerjs/sheets-formula @univerjs/sheets-numfmt
In Node.js an agent can create or load workbooks, read and write cells, insert and delete rows and columns, calculate formulas and save snapshots. Headless does not export .xlsx (that needs the Server SDK), take screenshots (that needs a rendering runtime) or store anything for you. Commercial features, including the Advanced Formula Engine, also run headless with a license. Use plugin mode in Node.js, because the default browser presets register UI plugins. In the browser, run formula calculation in a Web Worker for large workbooks.
GRID
GRID describes itself as "the spreadsheet engine for agentic products." Its @grid-is/spreadsheet-engine is a headless TypeScript library that runs in-process in the browser, Node.js 20+, Deno or Bun. It loads .xlsx, recalculates through a dependency graph, and writes .xlsx back with formulas, values, styles, number formats, comments and tables. @grid-is/agent-tools packages 27 tools (load and save, inspect, trace precedents and dependents, list formula errors, edit, what-if and goal seek) that run as an MCP server with npx -y @grid-is/agent-tools or plug into an agent SDK. GRID says every write returns a delta of what changed, plus warnings. Its features page lists goal seek and data tables, charts as still in development, and pivot tables as partly supported. The npm packages install with a free evaluation license; production or internal-workflow use needs a commercial license, priced per use case and not published.
Pick GRID if you want an engine and agent tools only, over MCP, and need goal seek or data tables. Pick Univer if you also need an embeddable spreadsheet editor, documents and slides in the same runtime, real-time collaboration, Worktree review for people, and an open-source core you can read and ship under Apache-2.0.
Excel add-ins: for analysts working in Excel
These tools fit a person updating a model in Excel today, not a team shipping its own product.
- Microsoft Copilot in Excel has edit, plan and chat modes. In edit mode it changes the workbook directly with Excel's own features, and plan mode lets you approve a plan first. Editing requires automatic calculation. You can undo, or restore a prior version.
- Claude for Excel is an add-in that traces assumptions, explains formulas with cell citations, adjusts assumptions while keeping formula relationships intact, and finds the source of errors such as #REF!. Anthropic says it is not recommended for final client deliverables without human review, and warns about prompt injection from untrusted files.
- ChatGPT for Excel builds, updates and explains multi-tab workbooks with formulas and assumptions. OpenAI suggests asking for a plan before big edits and duplicating the file first.
Which one to pick
- An analyst updating a model in Excel: Copilot in Excel, Claude for Excel or ChatGPT for Excel. Keep inputs on their own sheet, ask for a plan first, and work on a copy.
- A team building an agent product that needs a spreadsheet engine, an editor people can review in, and documents or slides: Univer.
- A team that needs an engine and agent tools only, with goal seek and data tables: GRID.
- A script that only moves formula text in and out of .xlsx, with no calculation: SheetJS Community Edition or ExcelJS.
If you only need XLSX in and out (JavaScript)
| Library | Reads and writes .xlsx formulas | Calculates formulas | License |
|---|---|---|---|
| SheetJS Community Edition | Yes, as formula strings | No: formulas calculate when the file opens in Excel; SheetJS Pro offers a calculator | Community and Pro editions |
| ExcelJS | Yes, as formula strings | No: the result "must be supplied" | Open source |
| Univer | Through the commercial file exchange (free Freemium tier for evaluation) | Yes, 500+ functions, in the open-source engine | Apache-2.0 core; Business from $99 a month |
| GRID | Yes, in the engine | Yes | Free evaluation; commercial license for production |
A formula-safe loop for any agent
- Load the workbook into a calculation engine, not a text parser.
- Map which cells are inputs and which hold formulas.
- Before writing, ask which formulas depend on the target cells.
- Write only to input cells; never write a value over a formula unless the task says to.
- Wait for recalculation, read the key outputs back, and check for #REF!, #VALUE! and circular references.
- Keep the change in a draft or a copy, and have a person compare formulas and values before merging.
- Export to .xlsx and open the file in Excel to confirm.
FAQ
What tools let an AI agent update a financial model in Excel without breaking formulas?
For an analyst working in Excel: Microsoft Copilot in Excel, Claude for Excel and ChatGPT for Excel, which edit through Excel itself. For a team building its own agent product: a spreadsheet engine with an API, such as Univer (open-source core, 500+ functions, headless in Node.js, Worktree review) or GRID (commercial engine with MCP agent tools). Either way, the edit goes through a calculation engine that rewrites references and recalculates dependents.
Can an AI agent insert rows into an Excel model without breaking formula references?
Yes, if the insert goes through a spreadsheet engine rather than the raw file. In Univer, insertRowBefore() rewrites the formulas below: in our test with the 1.4.0 packages, =B4-B5 became =B5-B6. Libraries that only store formula strings do not rewrite references.
Which JavaScript spreadsheet library can import and export real XLSX files with formulas intact?
SheetJS and ExcelJS read and write formula strings but do not calculate them. Univer calculates 500+ functions in its open-source engine and converts .xlsx through its commercial file exchange, with a free Freemium tier for evaluation. GRID loads and saves .xlsx in its commercially licensed engine. Test the round trip with your own files.
Is Univer's XLSX import and export open source?
No. The formula engine and editor core are Apache-2.0, but .xlsx conversion is part of Univer's commercial Server SDK. Freemium is free for development and testing, with a watermark and 10 exports a month; Business starts at $99 a month.
Can Univer run headless in Node.js for an agent?
Yes. The open-source packages load or create workbooks, read and write cells, insert rows and columns, calculate formulas and save snapshots in Node.js without a UI. Exporting .xlsx from Node.js needs the commercial Server SDK.
How many Excel functions does Univer support?
More than 500 Excel-compatible functions in the open-source formula engine, including NPV, XNPV, IRR, XIRR, PMT, XLOOKUP, LET, LAMBDA and dynamic arrays. The full list is on the Formula page of docs.univer.ai.
Can Univer handle circular references in a financial model?
Yes. Iterative calculation is open source and off by default. Enable it per workbook with a maximum number of iterations and a convergence threshold, then read getCircularReferences() to see each circular group and whether it converged.
How is Univer different from GRID?
Both are headless spreadsheet engines that agents drive through an API. GRID focuses on the engine and agent tools, offers goal seek and data tables, and is commercial with a free evaluation license. Univer adds an embeddable editor, documents and slides in one runtime, collaboration and Worktree review for people, and has an Apache-2.0 open-source core; it has no built-in goal seek or data tables.
How do I review an agent's changes before they reach the model?
In Excel, ask the add-in for a plan first and work on a copy. With Univer, the agent edits in a Worktree draft, and a person compares the draft with the original, with formulas shown, before merging, reopening or discarding it.