AI for Work
Analysing a spreadsheet with AI: what to strip out, and how to check the numbers
A spreadsheet is the one place where a plausible answer is worthless. Either the number is right or it is not. The good news is that these assistants do not have to guess: for this kind of task they write and run real code. The condition is that you check the code, not the prose around it. Here is the working method, the constraints the publisher documents, and what to remove from the file first.
Two modes, and only one of them computes
When you paste a table into a chat window and ask for a total, the model can answer from the shape of the text. When it runs code, it actually computes. OpenAI documents the second mode plainly: for some data-analysis tasks, ChatGPT writes and runs Python code in a stateful Jupyter notebook environment, can use files made available to the session, and can display tables interactively.
The same documentation gives the instruction that matters most in this whole guide: when ChatGPT uses Python for analysis, review the generated code, outputs and assumptions before relying on the result. And if the answer depends on a specific method, ask it to show or adjust that method.
So the rule is simple. For anything numerical, you want the code visible. "Show me the code you ran" is not a power-user trick, it is the only way to review the work.
Before the file goes anywhere: strip it
A business spreadsheet usually contains more than the question needs: customer names, emails, salaries, addresses, sometimes health or HR information. The GDPR's minimisation principle requires personal data to be adequate, relevant and limited to what is necessary for the purpose. The CNIL's position on generative AI services is to avoid entering personal data as far as possible, and it recommends that organisations define a list of authorised and prohibited uses, for example not providing personal data to the system.
In practice, five minutes of preparation:
- Delete the identity columns. Names, emails, phone numbers, account numbers. Keep an internal row number if you need to match results back.
- Keep the columns the question needs and nothing else. If the question is about monthly revenue by region, the file needs a date, an amount and a region.
- Round or band what is sensitive but needed. A salary becomes a band; a date of birth becomes an age group.
- Check the hidden sheets and hidden columns before uploading. This is where confidential data travels unnoticed.
- Turn off reuse and history in the privacy settings where the service allows it, as the CNIL advises, before the first upload.
The CNIL adds a point for anyone building this into a product rather than doing it by hand: with an API, control of the system sits almost entirely with the provider, so be particularly careful about what is submitted and about contractual terms, including transfers of data outside the EU.
The constraints the publisher documents
These four are from OpenAI's own help page, and each one explains a failure you will otherwise blame on yourself:
- A file can upload and still not be fully analysed if it is too large, too complex, image-heavy or poorly structured. The suggested fix is to ask it to inspect specific sheets, rows, columns or sections, or to split the file.
- Exact values from images are unreliable. Scanned PDFs, image-based tables and complex visual layouts are the wrong input when the numbers matter; upload a spreadsheet or text-based file instead.
- The Python environment cannot make external web requests or API calls. If the analysis depends on outside data, you have to upload it or connect an available source.
- The method may not match your intent on the first try. The documented answer is to specify the method, chart type, grouping or column you want.
Read those as a checklist of what to say in the prompt, rather than as flaws.
The prompt that produces a reviewable answer
Analyse the attached file with Python and show me the code you run. Before any result: tell me how many rows and columns you read, the column types you detected, how many empty cells per column, and any duplicate rows. Do not clean anything without telling me what you removed. Then answer this question: [your question]. Give the result, the code, and the exact numbers used, not a rounded summary.
The first half is the part everyone skips, and it catches the most. Row count, types, blanks and duplicates are where real spreadsheets break: a column read as text instead of numbers, three hundred blank rows at the bottom, a date in two formats.
Then the second request, always:
List everything you had to assume to produce that result: how you handled blanks, how you parsed dates, what you excluded, and any row you could not interpret. For each assumption, say how the result would change under the opposite choice.
How to verify in two minutes
- Check the row count against the file. If it read 1 180 rows and your file has 1 240, stop there.
- Recompute one cell by hand. Pick one group, filter it in the spreadsheet, and compare. One match is a strong signal; one mismatch ends the discussion.
- Check the total. The sum of the categories must equal the overall total, to the cent.
- Read the code, specifically the filters. Most wrong answers come from a filter that quietly dropped rows, not from arithmetic.
- Ask the same question differently and see whether the number survives. Consistency is not proof, but inconsistency is a finding.
What not to delegate
Three categories where the assistant should produce the draft and never the final word: anything that goes to a client or a regulator, anything that feeds a decision about a person, and anything you cannot verify by hand. For the last one, the honest answer is often that the analysis is too complex for a chat window and belongs in a spreadsheet or a notebook you keep.
We have not yet run our own hands-on tests on these analysis features, so this guide gives no price, no limit figure and no comparison between tools. The constraints above are the publisher's own, and the verification routine works whichever tool you use.
Tools in this guide
- Vendor information
ChatGPT
General-purpose assistant for drafting and research.
WritePrice: to verify
- Vendor information
Claude
Assistant for long documents and careful writing.
WritePrice: to verify
- Vendor information
Gemini
Google's assistant, linked to Workspace.
WritePrice: to verify
Questions
Does the assistant really calculate, or does it guess?
Both, depending on the task. OpenAI documents that for some data-analysis tasks ChatGPT writes and runs Python code in a stateful Jupyter notebook environment. The same documentation asks you to review the generated code, outputs and assumptions before relying on the result.
Can I upload a scanned table or a screenshot?
You can, but not when the numbers matter. The publisher states that ChatGPT may not reliably extract exact values from image-based tables, scanned files or files with complex visual layouts, and recommends uploading a spreadsheet or text-based file instead when exact values matter.
What must come out of the file before I upload it?
Anything that identifies a person and anything covered by confidentiality. The GDPR's minimisation principle requires data limited to what is necessary, and the CNIL advises avoiding the entry of personal data as far as possible in these services.
Sources
- OpenAI Help Center, Data analysis with ChatGPT
- CNIL, Les questions-réponses de la CNIL sur l'utilisation d'un système d'IA générative
- Regulation (EU) 2016/679 (GDPR), Article 5(1)(c), data minimisation, EUR-Lex
One AI email a week. Only what changes something for you.