How to Use AI on a Spreadsheet and Still Trust the Numbers

An early twentieth-century Triumph adding machine with eight columns of numbered wheels running from 0 to 9 beneath a row of small result windows.

Written by

in

The safe way to use AI on a spreadsheet comes down to one rule: make it calculate, not read. A model that reads your numbers as text and tells you the total is predicting what a total probably looks like. A model that writes and runs code on the file is doing arithmetic, and it can show you that arithmetic. Then check the result against one number you worked out yourself, before you believe anything else it says.

This piece covers why that distinction matters, what changed in Excel and Google Sheets this autumn, and a five-step routine with a prompt you can copy.

Built from Anthropic’s, OpenAI’s, Microsoft’s and Google’s documentation, checked on 25 October 2026. Nothing here was tested hands-on. The worked example is arithmetic on a small illustrative table, not a test of any AI tool.

The short version

  • Ask for code, not an answer. Chat assistants that can run code do not always choose to. Anthropic documents that Claude answers “simple arithmetic” directly unless you ask it to run code.
  • Reconcile before you trust. Compare the row count and one total against figures your spreadsheet already gives you. If they do not match, stop.
  • Excel’s in-cell AI function is gone. Microsoft retired the COPILOT function on 14 September 2026. Cells that used it turn into #NAME? errors when they recalculate.
  • In-cell AI is for words, not sums. Google’s AI function in Sheets is documented for text, summaries, categories and sentiment. Use it there.

Reading a table is not calculating from it

When you paste numbers into a chat, the model receives them the same way it receives any text: as a sequence of tokens. It can produce a total that looks right, but nothing in that process adds the column up. That is the same mechanism behind why AI makes things up: fluent, plausible output with no step that checks it. It is also why asking twice can give you two different totals.

Running code is different. OpenAI describes its Code Interpreter as letting models “write and run Python code in a sandboxed environment to solve complex problems in domains like data analysis, coding, and math”. Anthropic’s code execution tool loads uploaded CSV and Excel files into a Python environment with standard data libraries (Anthropic). When the arithmetic is done by code, the answer is only as wrong as the code, and the code can be read.

The catch is that the model decides when to run code. Anthropic’s documentation lists what Claude answers directly, without running anything: “Simple arithmetic and well-known math facts”, alongside factual and conversational requests. Its advice for anything borderline is to ask: “If you want Claude to run code for a borderline request, ask explicitly (for example, ‘run code to verify this’).”

A sum over forty rows can look simple to a model. So ask every time. Both pages describe developer tools. The chat apps offer their own versions, and which plans include them varies, as our look at what free AI plans include found.

What changed in the spreadsheet apps

Excel. Microsoft’s COPILOT function, which put an AI prompt inside a cell, was a preview feature. Microsoft’s page now opens with a notice: “Starting September 14, 2026, the COPILOT function is no longer available in Microsoft Excel.” Results already calculated stay in the workbook as cached values, but “when a cell that contains the function recalculates, the function returns a #NAME? error” (Microsoft). Our suggestion: if an older workbook relies on those cells, keep a copy with the results pasted in as plain values before anything triggers a recalculation.

Microsoft points people to the Copilot pane instead. For calculations, its own guidance leans on formulas: “For a precise calculation in one cell, Copilot can suggest a formula and explain how it works” (Microsoft). That is the right instinct. A formula is something you can read, and it recalculates when the data changes.

Google Sheets. The =AI() function is documented for generating text, summarising, categorising, sentiment and looking things up on the web. Google’s list of limitations is worth reading in full (Google):

  • “Responses are limited to text.”
  • It “doesn’t have access to your entire spreadsheet”, so Google recommends passing it the range it needs.
  • “You can’t undo or redo your function”, only regenerate it.
  • If a prompt pulls in other cells by joining them into the text, Google warns that changes to those cells do not prompt a refresh, so you have to decide when to regenerate.

None of that is a criticism of the tools. It is the vendors telling you what the in-cell AI is for: words. Numbers belong to formulas and code.

A five-step routine

  1. Work on a copy. Never point an AI tool at the only version of the file. Google’s own function cannot be undone, and a chat assistant that writes a “cleaned” file back to you has made a new file, not a checked one.
  2. Clean the shape first. One header row, one record per row. Note any total or subtotal rows, merged cells, notes or blank lines, and either remove them from the copy or tell the model exactly where they are. These are what break otherwise correct calculations, as the example below shows.
  3. Make it compute, and say how. Ask it to run code, report how many rows it read, and show the code. The prompt below does this.
  4. Reconcile against numbers you already trust. Before reading its answer, check two things against your spreadsheet: the row count (=COUNTA on a column with no blanks) and one total (=SUM). If either is off, stop and find out why. Nothing downstream can be right.
  5. Spot-check rows you choose. Pick two or three records yourself, starting with the ones that matter most, and trace them through the result. Our fact-checking routine works the same way: you decide what gets checked, starting with what could hurt you, not the system you are checking.

The prompt

I've uploaded a copy of a spreadsheet. Before answering anything:
1. Use code to load the file. Tell me how many rows and columns you read,
   and list the column names.
2. Tell me about any rows that look like totals, subtotals, notes or blank
   lines, and leave them out of every calculation.
3. Then answer this, calculating it with code rather than by reading the
   numbers: [your question]
4. Show me the code you ran and the exact figures it produced.

To adapt it: if your file has several sheets, name the one you mean in step 1. If you need a new column rather than an answer, ask for a spreadsheet formula instead of code, so the logic lives in the file and recalculates when the data changes. The idea of asking for evidence you can check in seconds comes from our prompts for work that check their own answers.

Worked example: the total row

Here is a small sales sheet of the kind most people keep, with a total row at the bottom. The figures are illustrative.

RegionOrdersRevenue
North112$18,400
South95$15,250
East130$21,900
West88$14,050
Total425$69,600

Now ask for total revenue and average revenue per region. Code that adds up every row in the revenue column, which is a perfectly reasonable piece of code, includes the total row and reports $139,200, exactly double. The average per region comes out at $27,840 instead of the true $17,400, because it divides by five rows instead of four.

Notice what does not break. Average revenue per order comes out at $163.76 either way, because the total row doubles both the revenue and the orders. A check on that figure alone would pass. That is why step 4 checks a total and a row count, not just the number you asked for.

The reconciliation catches the problem in seconds: the code read five rows, your sheet has four regions, and =SUM over the four data rows says $69,600. Step 2 of the prompt asks the model to flag that row before it calculates, which is the cheaper fix. Step 4 is there for when it does not.

An open handwritten account book from 1833 to 1849 in a museum case, its pages ruled into columns of figures, with a total carried forward written at the foot of each page.
Photo: Andreas Praefcke / Wikimedia Commons, public domain.

Where AI in a spreadsheet does earn its place

The work the vendors document their tools for is mostly language, and that is where the time savings are real: sorting free-text feedback into categories, summarising a column of comments, pulling first names out of full names, explaining an inherited formula you do not understand, or drafting the formula you cannot remember. As our piece on where AI should start in a small business puts it, rules-based work is what a spreadsheet formula already does, more cheaply and without ever inventing an answer.

The thing worth remembering

A number from an AI tool is a claim until it agrees with a number you already trust. Make it calculate, make it show the calculation, and check one total and one row count before you read anything else.

Header photo: Gnangarra / Wikimedia Commons, CC BY 3.0 AU.

How this was made. AI Decode Wire uses AI tools for research and drafting. Factual claims link to their sources, and errors are corrected in the open. AI-assisted content policy · Report an error