Skip to content
mentoor

Topic 5 of 5 · 4 min read

Spreadsheets and tables as context

Goal: Choose the right way to give a spreadsheet to an assistant and catch an answer based on a partial read of the rows.

Counting, adding and filtering are things a model does badly by reading, and well by running code, so match the way you hand over a spreadsheet to the question you ask.

Check yourself · 1 of 3

You need the exact total of 3,000 expense rows. What is the best way to get it from an assistant?

Choose one answer

Why it matters

A language model predicts text. When it "reads" 5,000 rows of sales data and you ask for the total, it does not add them up the way a calculator does. It may estimate, skip rows or drop the rows it never received. The total looks exact and is wrong.

Three ways to give data

  1. Paste a small table into the chat. Good for a few dozen rows. The model sees every cell. Use it for reading and reasoning about a short table, such as "which of these five quotes is cheapest and why?".
  2. Upload the file and let the tool read it. The tool may read only part of a big sheet, or flatten several tabs. Check what it says it loaded.
  3. Upload the file and let the assistant run code. Many tools, such as ChatGPT's data analysis and Claude's analysis tools, can write and run a short program over the file. The program does the counting and the maths exactly, and the model explains the result. The upload help pages for ChatGPT and Claude describe what each supports. Use this for totals, averages, filters, groups and charts.

Rule of thumb: words about data come from the model; numbers about data should come from code.

How to ask

  • Ask the assistant to state first how many rows and columns it loaded, and the column names.
  • Ask it to show the steps or the code it ran, so you can check the logic.
  • Ask for a check number, such as the row count after filtering.
  • If there are several tabs, name the tab you want.

Before and after

Before: "Here is our sales file. What was the total for March?"

After: "Use code on the attached file. First tell me the sheet name, the number of rows and the column names. Then filter to rows where the date is in March and add up the Amount column. Show the row count you used and the total."

The assistant now gives a row count you can compare with the sheet.

What goes wrong

  • Dropped rows. The tool loads the first part of a big sheet and ignores the rest. The answer is based on a sample but reads like a full result.
  • Miscounts. Asked to count by reading, the model gives a round or near number.
  • Messy data. Merged cells, notes above the header, dates stored as text and totals rows inside the data all confuse the load. A total row counted as data doubles the sum.
  • Hidden tabs and filters. Hidden rows may be included or excluded without a word.

Quick check: compare the assistant's row count and one total with the same figure from the spreadsheet itself. If those two match, the rest is much more likely to be right.

Examples

Catching a partial read

A sheet has 4,200 rows. The assistant says "the average order is 61.40, based on 1,000 rows". The row count exposes a partial load. The user asks the assistant to load the full file with code and recompute.

A totals row counted twice

An expenses sheet has a bold "Total" row at the bottom. Code that sums the whole column adds that row too, so the result is exactly double. Asking "list the last three rows you used" would show the totals row inside the data.

Key points

  • Models read tables as text, so counting and adding by reading is unreliable on anything but small tables.
  • Paste short tables, upload larger ones, and let the assistant run code for totals, filters and averages.
  • Ask the assistant to report the sheet name, row count and column names before it answers.
  • Big sheets may load only in part, so compare the row count with your own spreadsheet.
  • Merged cells, totals rows and text dates cause wrong results even when code is used.

Common mistakes

  • Asking for a total by reading, with no code and no row count.
  • Not checking how many rows and which tab were loaded.
  • Leaving totals rows, notes or merged cells in the data.
  • Trusting a precise-looking number without comparing it to the spreadsheet.

Check yourself · 2 of 3

An assistant says the average is 61.40 "based on 1,000 rows". Your sheet has 4,200. What does this most likely mean?

Choose one answer

Check yourself · 3 of 3

Why can a "Total" row at the bottom of a sheet ruin a sum done by code?

Choose one answer

Practice items, not counted towards your mastery.

Start here