Lesson 3 of 6 · Working with Documents and Data

Spreadsheets and tables

A language model reads a spreadsheet the way you would read a phone book aloud: it can say every number, and it will still get the total wrong. The fix is to make it compute instead of guess.

Spreadsheets are where AI both shines and embarrasses itself. Ask it to explain what a column means, suggest a better layout, or write the formula you need, and it is excellent. Ask it to add up column C and it may confidently give you a number that is off by a hundred dollars. This lesson explains why that happens and the two-word fix: run code.

Numbers are just text to a language model

Remember from AI Basics: a language model reads tokens and predicts the next one. The number 2,150 is not a quantity to it. It is a few tokens that look like a number. When it "adds" a column, it is predicting what the sum of those tokens probably looks like, based on having seen millions of sums in training. For two or three small numbers, that prediction is usually right. For a column of 40 dollar amounts, it is an educated guess dressed up as arithmetic.

The same goes for counting. "How many rows say Fall cleanup?" sounds trivial, but the model has to hold every row in attention at once and keep a tally it has nowhere to write down. It skims, it loses count, and it reports the number with the same steady confidence it uses for everything, the pattern you saw in Trust and limits.

Tap a question, then compare an eyeballed answer to a computed one

JobCityAmount
Fall cleanupSt. George$340
Sod installWashington$2,150
Drip repairHurricane$185
Fall cleanupSt. George$360
Tree trimWashington$475
Fall cleanupHurricane$325
Drip repairSt. George$210
Sod installSt. George$1,980

Eyeballed (read as text)

There are 4 fall cleanups.

Off by one. The model skimmed and lost count. Small lists hide this; long ones make it common.

Computed (code ran)

Illustrative. The eyeballed slips are typical of a model reading a table as text. The computed answers are exact for the table shown.

Four specific things go wrong, and knowing them helps you spot the answers that need a second look:

  • Attention drifts. One unusually large number pulls the model's focus, and it answers from an impression of the table instead of a pass through it.
  • Near-duplicates blur. "Fall cleanup" and "Fall clean-up" and "fall cleanup" may be counted as the same thing, or not, depending on the mood of the prediction. A real filter would ask you which you meant.
  • Long tables get truncated. If the sheet overflowed the reading window (lesson 2), the model summed the rows it saw and never knew there were more.
  • Formatting lies. A total row at the bottom, a subtotal in the middle, a hidden column: to you those are obviously not data rows. To the model, they are rows, and they get added in.

Ask for the method, every time

The single best habit for spreadsheet questions is to ask how the answer was reached, not just what it is. "Show me the steps" or "show the code you ran" does two things. It forces the tool to use its calculator instead of its impression, and it gives you something to verify. You do not need to read code. You need to read the plain-English version of it: "filtered the job column for the exact text Fall cleanup, then counted 3 rows." If the method sounds right, the number is right.

The second habit: check one thing by hand. Pick a single cell or a single small group and verify it yourself. If the AI says Hurricane totaled $510 and you can see two Hurricane rows that add to $510, the method is working, and you can trust the bigger numbers that came from the same method.

The code-running features, without the jargon

All three major tools can now write and run small programs on your behalf, in a locked sandbox on their servers, not on your computer. The names are inconsistent, so here is the map as of August 2026:

  • ChatGPT: data analysis. Upload a spreadsheet or CSV and ask a question. For analysis tasks, ChatGPT writes and runs Python code (a common programming language) in the background, can show results as interactive tables, and can draw bar, line, pie, and scatter charts. OpenAI's own help page tells you to review the generated code, outputs, and assumptions before relying on the result, and to ask it to show or adjust the method. Good advice.
  • Claude: code execution and file creation. Claude gets a private computing environment inside the chat where it can run code, analyze CSV and other data files, and create Excel, Word, PowerPoint, and PDF files. It is available on all plans including Free; on Free, Pro, and Max you switch it on under Settings, then Capabilities. Team and Enterprise have it on by default. Excel (.xlsx) uploads need it switched on.
  • Gemini: charts from uploaded spreadsheets. Upload a spreadsheet to the Gemini web app and ask for a chart; it builds one you can zoom into and adjust. If your data lives in Google Sheets, Gemini inside Sheets can build tables, formulas, and editable charts in place, which needs an eligible Google Workspace or Google AI plan.

The tell that code ran: the answer arrives with a table you can sort, a chart, or a "show code" link, and the numbers are exact rather than rounded. The tell that it did not: a paragraph of prose with "about" and "approximately" in it.

What AI is genuinely great at with spreadsheets

None of this means keep AI away from your numbers. It means use it for the jobs that fit. Without running any code at all, a language model is excellent at: explaining what a column or formula means in plain English, writing the Excel or Google Sheets formula you describe ("sum column C only where column B says Hurricane"), spotting a layout problem ("your dates are stored as text, which is why sorting looks wrong"), and turning a clean table into a paragraph for an email. Those are language tasks that happen to involve a spreadsheet, and the model does them without counting anything.

A good division of labor: let the AI write the formula, then put the formula in your own sheet and let the sheet do the math. Your spreadsheet is a calculator that never guesses. The AI is the colleague who knows which formula to reach for. Together they beat either one alone, and you never have to trust an eyeballed total.

Prepare the sheet before you upload

Five minutes of cleanup prevents most bad answers, because it removes the things the model has to guess about:

  • One header row, real words. "Revenue (USD)" beats "Amt." The header is the only place the model learns what a column means.
  • One record per row. No merged cells, no two tables side by side, no notes typed into a spare column.
  • Delete total and subtotal rows. The AI will add them in as if they were jobs. Let it compute its own totals.
  • One sheet per upload. If the workbook has six tabs, save the one you care about as its own CSV. Many tools read only the first tab, or read all six and blend them.
  • Consistent spelling. Pick "Fall cleanup" and use it everywhere. Find and replace takes ten seconds.

Try this yourself

Export any list you keep, jobs, invoices, inventory, as a CSV. Upload it and paste this:

Use code to answer, not estimation. For this file:
1. Tell me the number of rows and list the column headers exactly as written.
2. Total the [amount column name] column and show the method you used.
3. Group by [category column name] and give me the total and the count for each group, sorted largest first.
4. Flag any rows that look like totals, blanks, or duplicates that I should remove.
If you cannot run code in this chat, say so before answering.

Replace the bracketed names with your real headers. Then pick one group and add it up yourself. If your hand total matches, you have a method you can reuse on every sheet from now on. If the tool says it cannot run code, switch the feature on, or use a tool that can, before you trust any number it gives you.

Next lesson4. RAG in plain English

Last updated August 24, 2026