Skip to content
Start free

What does an AI do with your file before it gives you a number?

See what happens between your question and the number: the assistant turns your words into a calculation, writes code, runs it, and sums it up for you.

Free course. Your Maestro, an AI, .

When you give an assistant a spreadsheet and ask for a number, it doesn't guess by looking at the table. For a calculation on your data, the three assistants in this course write code and run it, according to their own makers. Microsoft says Copilot in Excel uses Python-based analysis to interpret your question. OpenAI says ChatGPT writes and runs the Python code for you when you upload your data and ask a question. Anthropic says Claude can write and run code, for example Python, to analyze the files you upload.

That is good news. Code always does the same calculation, and you can read it, repeat it, and check it. It also means the number you get is exactly the calculation the code did, no more and no less. If that calculation wasn't the one you needed, the number comes out sounding just as sure.

From your question to the number

Whichever assistant you use, to answer with a number it has to go through these steps, even if it doesn't show them to you:

  1. Looks at the table

    It sees which columns exist and what they are called. From that it assumes what each row represents, even if the file doesn't say so anywhere.

  2. Turns your words into a calculation

    "Sales" can mean counting rows or counting distinct tickets. "Average ticket" can be the average of a column, or a sum per ticket and then an average. This is where the decisions that change the result the most are made.

  3. Writes the code and runs it

    It decides which rows to use, whether to filter anything, and what to do with empty cells. The code does the arithmetic without errors, on the rows and columns it chose.

  4. Tells you in words

    It turns the result into a sentence like "In March there were 312 sales." By the time you read that sentence, the decisions from the earlier steps are no longer visible.

The step that matters is the second one. Your question is in business words, and the table is in columns and rows. Someone has to decide how to get from one to the other. If you don't say it, the assistant decides.

The decisions you don't see

With the hardware store's file, a question as simple as "how many sales were there in Zapopan?" hides at least four decisions:

  • What a sale is. The file has one row per product. Counting Zapopan's rows gives 89; counting distinct tickets gives 30.
  • Whether canceled ones count. Two of those Zapopan tickets were canceled. Are they sales?
  • What to do with repeated rows. The system exported some rows twice. If nobody removes them, they count double.
  • What to do with the sale that has no branch. One ticket was entered without a branch. It isn't Zapopan's, but it isn't any other branch's either.

Each decision has a reasonable answer, and each answer gives a different number. There isn't an "AI number" and a "real" one: there are numbers that answer different questions. Your job is to know which one it answered. Which of these decisions do you think has happened to you without noticing?

Where to see what it did

You don't need to read Python fluently to check these decisions. The first step is to see the code or, at least, to ask for an explanation of it. Each assistant shows it in its own way; pick the one you use:

OpenAI says, in its guide to analyzing data with ChatGPT, that when you upload your data and ask a question, ChatGPT writes and runs the Python code for you. Its example files are CSV and XLSX, and it recommends reviewing the code and the tables it generates carefully, and verifying important results yourself before sharing them.

You don't need to hunt for a button: what always works is asking for the code in the chat, right after its answer:

Text
Show me the code you ran to get that number, and explain in one sentence what each step does.

Microsoft says Copilot in Excel uses Python-based analysis to interpret your question and calculate the answer, and that you can expand the code to see how it was generated. It works with tables or with ranges that look like a table, in Excel for Microsoft 365.

When it gives you a number, open the code and, if you don't understand it, ask in the same pane:

Text
Explain in plain words what the code you used does, step by step.

Anthropic explains that Claude can write and run code, for example Python, and analyze the CSV files you upload. It also says Claude gives you summaries as it works, so you can follow what it's doing.

If you can't see the full code in the summary, ask for it in the chat:

Text
Show me the code you ran to get that number, and explain in one sentence what each step does.

In the code you won't be looking for programming errors. You will look for three things you can read even if you don't know Python: which columns it used, whether it filtered or removed rows, and what operation it did (count, sum, average, divide). On the next page you learn to read the four or five lines you will see most often.

Try it

Think of the last time an assistant gave you a number about one of your tables, or ask a new question. Ask it for the code and, without reading it line by line, look only for those three things. A good answer looks like this: "it used the importe column, filtered nothing, and summed." If you can't find one of the three, you already have your first question for the assistant. If you like, we can go over what it told you together.

Note: Before uploading data from your job

Check what your company allows you to upload to each assistant, and with which account. In this course everything is practiced with made-up data, so you risk nothing here.

Check yourself: You ask your assistant "how many sales were there in Zapopan?" and it answers 89. Where was it decided what counts as a sale?