Hub › Lessons › Working with your data
Upload a CSV file to Claude, ask questions, and check every answer
A CSV export from your bank, shop or timesheet app holds answers you need: what you earned last month, which product sells best, how many hours you can bill. Claude can read the file and answer in plain English. The risk is a confident number that is slightly wrong, because a blank cell, an "S$" in the wrong place or a client name typed two ways was handled in a way you did not expect. This lesson gives you one prompt that makes Claude check the file first, calculate with code, and hand you a spreadsheet formula so you can confirm each answer yourself.
What you will be able to do: give Claude a CSV file, get answers that list which rows were included and left out, and check every number with one formula in Google Sheets or Excel before you rely on it.
What you need
- A Claude account. Anthropic's Help Center lists CSV as a file type you can upload to a chat, with up to 20 files per chat.
- Code execution turned on. In Claude, go to Settings › Capabilities and turn on Code execution and file creation (newer layouts call it Create and edit files). The Help Center says it is available on all plans, including Free. On Team and Enterprise plans, the organisation owner controls it. This setting is what lets Claude run Python on your file instead of reading the numbers and adding them up itself.
- Your data as a CSV file, with column names in the first row. Most banks, shop platforms and timesheet apps offer CSV as an export option. The Help Center pages give different per-file size limits (30 MB on the code execution page, 500 MB on the upload page), so if your file is large, split it or check the current pages.
- Google Sheets or Excel, to run the check formulas.
Before you upload
- Use a copy, and remove what Claude does not need. The file's contents are sent to Anthropic to be processed. Delete columns with full account numbers, card numbers, NRIC numbers or other people's personal details from your copy, and check your account's data settings.
- Know your date order. Look at a date such as
13/10/2026. If the day comes first, your spreadsheet must also read dates day first, or the check formulas will miss rows. In Google Sheets, the locale under File › Settings controls this; Singapore and the UK read day first, the US reads month first.
The steps
- Start a new chat in Claude and attach your CSV file. The Help Center article Upload files to Claude shows how on web, desktop and mobile.
- Paste the prompt below. Under "My questions", type two or three questions, each about something in the file.
- Read the file check first. Does the row count match what you expect? Are the first and last dates right? Do you agree with how each problem was handled? If not, reply with the correction, for example "the blank amount on order 1018 was 8.90", and ask Claude to answer again.
- Open the same CSV file in Google Sheets or Excel. Paste each check formula into an empty cell to the right of the data.
- If the formula gives the same number as Claude, you have two independent routes to the same answer. If it does not, paste both numbers back into the chat and ask Claude to explain the difference before you use either.
The prompt
Copy it as it is, then add your questions at the end.
The attached CSV file is my data. Answer my questions at the end using only this file. First, check the file and tell me: - how many rows and columns it has, and the column names - the first and last date - any problems: blank cells, numbers stored as text, the same name spelled two ways, or values that look unusual For each problem, say how you handled it. Then answer each question: - Calculate with code. Do not estimate or retype the numbers. - Give the answer, which rows you included, which you left out, and why. - Give one spreadsheet formula I can paste into Google Sheets or Excel to check the answer myself. Assume I open the file as it is, with the headers in row 1, and that the dates become real dates. Use DATE() for date ranges, not text matching. Make the formula cope with the problems you found. - If the file cannot answer a question, say so instead of guessing. My questions: 1.
Questions that work well
- Totals and counts for a period: "What was my paid revenue in October 2026, and how does it compare with September?"
- Rankings: "Which product brought in the most paid revenue?"
- Groups: "How many billable hours did I log for each client in October?"
Avoid questions the file cannot answer, such as "why did sales go up?". A sales export shows what happened, not why. The prompt asks Claude to say so rather than guess.
Worked example
We ran the prompt on 10 November 2026. The shop data is made up for illustration: 98 orders from September and October 2026 for a small online shop, with columns order_id, date, product, qty, amount_sgd, status. We built five problems into it:
- one paid order with a blank amount
- one amount typed as
S$90.00 - one amount with a thousands comma,
"1,350.00" - one product name in lower case,
content planner - one unusually large order: 30 logo kits, when every other order is for 1 to 3 items
The questions were: (1) paid revenue in October 2026 compared with September, (2) the product with the most paid revenue across both months, and (3) how many orders were refunded.
The file check (excerpt, as returned)
Problems Claude reported, and how it handled them. On a phone, scroll the table sideways.
| Problem | Where | How Claude handled it |
|---|---|---|
| Blank amount | Order 1018 | Left it out of revenue rather than invent a number; noted it was probably 8.90 and that September would be S$1,159.40 if so |
| Number stored as text | Order 1053, S$90.00 | Removed "S$", counted 90.00, and noted it matches 2 × 45.00 |
| Number stored as text | Order 1098, "1,350.00" | Removed the comma, counted 1,350.00 |
| Name spelled two ways | Order 1031, content planner | Treated it as the same product |
| Unusual value | Order 1098, qty 30 | Kept it, but showed every answer with and without it, and asked us to confirm it is real |
The answers (shortened)
Question 1 as returned. On a phone, scroll the table sideways.
| Sept 2026 | Oct 2026 | Change | |
|---|---|---|---|
| As the file stands | S$1,150.50 | S$3,049.50 | +S$1,899.00 (+165%) |
| Without order 1098 | S$1,150.50 | S$1,699.50 | +S$549.00 (+48%) |
Question 2: Logo starter kit, S$2,790.00, and still first without order 1098 (S$1,440.00). Question 3: 10 refunded orders, 4 in September and 6 in October. Claude added that the file does not say whether refunds were full or partial, which is true.
The check formula it gave for October, which copes with the blank cell, the "S$" and the comma:
=SUMPRODUCT((B2:B99>=DATE(2026,10,1))*(B2:B99<DATE(2026,11,1))*(TRIM(F2:F99)="paid")*VALUE("0"&SUBSTITUTE(SUBSTITUTE(E2:E99,"S$",""),",","")))
In a spreadsheet that read the file with day-first dates, this formula returned 3,049.5, the same as Claude's answer.
We also ran a second illustrative file: a month of time entries for three clients, with a client name that had a trailing space, another in lower case, a blank hours cell and one billable flag typed as y instead of Y. Claude found all four problems in each run and gave the same billable hours per client as our own script.
What we found in testing
- The first version of the prompt gave formulas that broke in a real spreadsheet. It did not mention dates, so Claude matched dates as text, for example looking for "10/2026" at the end of the cell. Once a spreadsheet turned those cells into real dates, the October formula returned 0, or S$2,262.10 when the spreadsheet read the dates month first. Claude's answers were right; only the check was wrong. The line about
DATE()in the final prompt fixed this in every run. - Without code execution, Claude did not invent totals. When we gave the same prompt with the CSV pasted in and no way to run code, Claude declined to calculate in 4 of 6 runs and listed the problems it could see instead. In the other 2 runs it added the hours up by reading and said clearly that the figures were not checked by code. Turn the setting on before you start.
- Your date setting matters. With month-first reading,
01/09/2026becomes 9 January and15/10/2026stays as text, so period totals in your spreadsheet come out wrong even with a correct formula.
Watch out for
- Rows quietly left out. Read the "left out" line for every answer. A blank amount left out is often right, but you should decide.
- Large one-off values. One bulk order changed the October growth from 48% to 165% in the example. Check unusual rows against the source before you report a trend.
- Formulas that refer to other cells. A formula such as
=H1/H2-1only works after you put the other results in those cells. Use the formulas that refer to the data columns as your check. - More than one file. To combine a year of monthly exports first, use merge monthly CSV exports with Claude Code, then ask your questions of the merged file.
Next step
Sort the transactions into categories
If your CSV is a bank export, categorise your transactions with AI shows how to put every row in a category, with uncertain rows flagged for you. To keep income and expenses in Notion, the Notion Finance Dashboard product page lists an income and expense tracker, a budget and cash-flow views, with the requirements and the price.
See what's inside the Finance DashboardMore lessons
Also on working with your data: merge a year of CSV exports into one file and run a monthly cash review.
All lessonsHow we checked this lesson
- Prompt tested on 10 Nov 2026 with Claude Code 2.1.321 in print mode, with the CSV file in the working folder and permission to read files and run Python. This runs Python on the file in a similar way to the code execution setting, but we did not test the upload button in the Claude app itself, and results in a chat may be worded differently.
- Version 1: 6 runs on the 2 illustrative files. Version 2 (on this page): 6 runs. In all 12 runs the answers matched our own independent script (October S$3,049.50, September S$1,150.50 with the blank row left out, Logo starter kit S$2,790.00, 10 refunds; billable hours 22.0, 16.5 and 14.5; most non-billable hours Lee Renovation, 5.0), and every built-in problem was reported.
- Every check formula was pasted into a spreadsheet (LibreOffice Calc, file imported with day-first dates) and its result compared with the answer. Version 2: 17 of 17 formulas that refer to the data columns returned the correct number. Version 1: the date-based formulas did not (see "What we found").
- No-code test: 6 runs with the CSV pasted into the prompt and no tools available, as described above.
- File types, file count, size limits and the code execution setting were checked against Anthropic's Help Center on 10 Nov 2026: Upload files to Claude and Create and edit files with Claude. These can change; the official pages are the authority.
- AI output varies. Always read the file check and run at least one check formula before you rely on an answer.
- Last reviewed: 10 November 2026.