CountLineage

Claude for data analysis: what it does well, and where to check it

Claude features · Facts checked 22 October 2026

Yes, Claude can analyse data. With code execution on, which is the default on most plans, it writes and runs Python in a sandbox on your CSV or Excel files, draws charts, and produces .xlsx, .docx or .pptx files. Code makes the arithmetic dependable; its choices of definitions, filters and joins are what to check.

Claude analyses data by writing code, which is why it can

A marketing operations manager uploads a 40,000-row export of ad spend and conversions and asks Claude for return on ad spend by channel for the last quarter. Claude doesn't read the rows and estimate. It writes a short Python script, runs it in a sandbox, and returns a table, a chart and, if asked, a spreadsheet to download.

That code step matters. Language models doing arithmetic "in their heads" are unreliable: in one well-known study, GPT-4 got only 59% of three-digit by three-digit multiplications right without a tool (Dziri et al., Faith and Fate, 2023). Both Anthropic and OpenAI route calculations to code for that reason. Anthropic's API docs describe code execution as letting Claude "analyze data, create visualizations, perform complex calculations" in a sandboxed environment (Anthropic, Code execution tool).

In the Claude apps, this is the feature Anthropic calls file creation, or code execution. It replaced the earlier JavaScript "analysis tool" from October 2024, which Anthropic said gave "mathematically precise and reproducible" results (Anthropic, October 2024). Today, Claude can:

  • analyse uploaded files (CSV, XLSX, JSON, PDF and others) with Python;
  • create PNG charts and Python scripts;
  • create and edit .xlsx, .pptx, .docx and PDF files, which you can download or save to Google Drive.

For data that lives in a warehouse rather than a file, see Claude connectors: BigQuery, Snowflake and others have MCP servers Claude can query directly.

Getting a file analysed, step by step

  1. Check code execution is on. It's on by default for Free, Pro, Max, Team and new Enterprise organisations, under Settings > Capabilities. Owners can switch it off, so if Claude says it can't run code, ask your admin. Excel files need it; without it, Claude can't open .xlsx at all.
  2. Upload the file. Anthropic's upload limits allow up to 500 MB per file and 20 files per chat. Its file-creation help gives a lower figure, 30 MB per file, for files inside the code sandbox. If a large file fails, split it or aggregate it first.
  3. Ask it to describe the data before analysing it. Columns, types, row count, date range, obvious gaps. Thirty seconds of reading here catches the wrong file, the wrong sheet and the half-loaded export.
  4. State the definitions. Don't ask for "ROAS" and hope. Say which value and which cost.
  5. Ask for the method alongside the answer. The code, the filters, and any rows excluded.
  6. Export. Ask for the result as a spreadsheet or deck, or turn it into an artifact to share.

A prompt that does steps 3 to 5 at once (illustrative):

Attached is our Q3 paid media export. Before any analysis, tell me the columns,
the row count, the date range, and any columns with missing values.

Then calculate ROAS by channel for 1 July to 30 September: total conversion
value divided by total spend, per channel. Don't average daily ROAS values;
compute from totals. Exclude rows where campaign_type is "test".

Show the Python you ran, the number of rows used per channel, and a list of
anything you had to assume.

Note the line about averaging. A mean of daily ROAS values is not the same as total value divided by total spend, and it's an easy thing for anyone, human or model, to get wrong. Our ROAS metric page has the definitions.

Mistakes like that are hard to spot in a finished answer. Count connects to Claude and shows the calculation behind each number, so a mean of ratios is visible before it reaches a report.

See the query behind every number

Claude's code gets the sums right; the definitions and filters are where analysis goes wrong. Count traces each claim back to the query or calculation behind it, so you can see which choices it rests on.

Where it goes wrong: the decisions, not the sums

Once the code runs, the arithmetic is right. Errors come from what the code was told to compute. Five patterns account for most of what we see:

1. Picking one definition without saying so. "Churn" can mean customers lost or revenue lost. In ChartMogul's worked example, three customers pay $20, $30 and $50; the $50 customer leaves. Customer churn is 33%. Revenue churn is 50%. Same data, both correct, very different board slide. Google defines ROAS as conversion value divided by spend and ROI as profit divided by spend; ask for one and you may get the other.

2. Being thrown by irrelevant detail. Apple researchers found that adding a single irrelevant clause to maths problems cut accuracy by up to 65%; GPT-4o fell from 95.2% to 63.1% (Mirzadeh et al., GSM-Symbolic, 2024). Real exports are full of irrelevant columns and notes.

3. Reading the wrong number from a document. When the data arrives as a PDF report rather than a table, extraction is a weak point. Even given the right page of a filing, GPT-4-Turbo got 15% of FinanceBench questions wrong (Islam et al., 2023). Older model, same lesson.

4. Writing plausible SQL against a real schema. In the original Spider 2.0 paper, the best agent solved 21.3% of enterprise text-to-SQL tasks against 91.2% on the academic Spider 1.0 (Lei et al., arXiv v1, 2024). Agents have improved a lot since, but the wrong join or date column still gives a confident, wrong number.

5. Quiet filtering. Dropping rows with missing values, deduplicating, excluding test accounts. Each is often right. Each changes the answer, and none appears in the summary unless you ask.

On realistic tasks, AI still misses a lot

Saturated benchmarks make AI look near-perfect. Benchmarks built from real analyst work tell a different story:

Benchmark What it tests Best published score
SpreadsheetBench V2 321 end-to-end business workflows: financial models, debugging, visualisation 34.89% (checked October 2026)
DABstep 450+ real tasks from a payments analytics platform, combining code with reading documentation 14.55% on the hardest tasks at launch (June 2025)
Vals AI Finance Agent 537 entry-level financial analyst tasks 64.37%, Claude Opus 4.7 (June 2026)

These aren't measures of Claude in the chat app, and the models tested aren't all current. They're the best evidence available that multi-step analysis on real data is still hard, even for the strongest systems: roughly one in three analyst tasks missed on the finance benchmark, and about two in three spreadsheet workflows on SpreadsheetBench V2.

Our position: Claude is very good at the mechanics of analysis (loading, cleaning, reshaping, charting) and at explaining what it did. It saves real hours. It doesn't know your business's definitions unless you tell it, and it won't flag the decision it made silently unless you ask. For a direct comparison with OpenAI's equivalent, see Claude vs ChatGPT for data analysis.

Limits, plans and what happens to your data

Detail
Plans Code execution on Free, Pro, Max, Team and Enterprise
Upload size Up to 500 MB per file, 20 files per chat (upload limits); 30 MB per file in the code sandbox (file-creation help)
Usage Uses more of your plan's allowance than ordinary chat
Run time Task duration and session length are limited; Anthropic gives no figures
Network Free, Pro, Max: approved package managers by default. Team: package managers only. Enterprise: off by default, set by the owner

Anthropic is plain about the risk: the feature "gives Claude internet access to create and analyze files, which may put your data at risk". A prompt injection hidden in a file or web page could make Claude run untrusted code or send conversation data elsewhere, so Anthropic advises watching what Claude does and stopping it if anything looks unexpected. It mitigates with an injection classifier, per-user isolated sandboxes and resource limits. Public sharing of chats with file outputs is disabled on Free, Pro and Max.

For company data, the practical rule is to upload the extract the question needs, not the whole table, and to use Enterprise network controls if you handle anything regulated.

A two-minute check before the number leaves your screen

Anthropic's own help page advises that "you may need to review and refine Claude's outputs" and suggests starting with simple tasks. Fair. What follows is the review we'd do on any number that's going into a report.

  1. Rows in, rows out. Compare the row count Claude says it used with the row count of your file. A gap means a filter, and you should know what it was.
  2. Read the filters and joins in the code. Not the whole script: search it for the lines that drop, filter, merge or group. That's where the decisions live.
  3. Recompute one figure yourself. One cell, in a spreadsheet, from the raw data. If it matches, the rest is probably mechanical. If it doesn't, stop.
  4. Ask about definitions: "Which definition of [metric] did you use, and what other definitions could someone reasonably mean?"
  5. Reconcile one total against the source system: total spend, total customers, total revenue. If the totals don't match, nothing built on them will.

The deeper problem is that the code and the claims drift apart once Claude writes its summary. Count connects to Claude and splits the answer into claims, each with a reasoning chain showing the query or calculation behind it, and labels the ones that rest on assumptions. Its canvas also runs SQL and Python against your warehouse, so you can open the step that looks wrong and re-run it.

Questions people ask

Can Claude analyse data?

Yes. With code execution on, Claude writes and runs Python on files you upload, such as CSV and Excel, and returns tables, charts and downloadable files. It's available on every plan, including Free. Check the definitions and filters it chose before relying on the result.

Can Claude read Excel files?

Yes, as long as code execution is enabled; Anthropic's help centre says XLSX support needs it. Claude can also create and edit .xlsx files and return them for download or save them to Google Drive.

How large a file can Claude analyse?

Anthropic's upload help allows up to 500 MB per file and 20 files per chat, while its file-creation help gives 30 MB per file inside the code sandbox. In practice, if a big file fails, aggregate or split it before uploading.

Is Claude better than ChatGPT for data analysis?

Both run Python on your files, and both get the arithmetic right once code is involved. The difference that matters most is how clearly each explains its choices, which you can test by giving both the same file and question. Our Claude vs ChatGPT for data analysis guide compares them in detail.

Is it safe to upload company data to Claude?

Anthropic warns that code execution gives Claude internet access, which may put data at risk through prompt injection, and mitigates this with isolated sandboxes and an injection classifier. Upload only the extract you need, and on Enterprise use the network controls to restrict outbound access.

Sources

  1. Anthropic Help Centre: Create and edit files with Claude (checked 22 October 2026)
  2. Anthropic Help Centre: Uploading files to Claude
  3. Anthropic: Code execution tool
  4. Anthropic: Introducing the analysis tool (October 2024)
  5. SpreadsheetBench: leaderboard, V1 and V2 (checked 22 October 2026)
  6. Adyen and Hugging Face: DABstep, Data Agent Benchmark for multi-step reasoning (arXiv, June 2025)
  7. Vals AI: Finance Agent benchmark (updated 4 June 2026)
  8. Dziri et al.: Faith and Fate, limits of transformers on compositionality (2023)
  9. Mirzadeh et al. (Apple): GSM-Symbolic (2024)
  10. Islam et al. (Patronus AI): FinanceBench (November 2023)
  11. Lei et al.: Spider 2.0 (arXiv, November 2024)
  12. ChartMogul: Customer churn rate
  13. Google Ads Help: ROAS and ROI definitions

Early access

Count Lineage isn't ready to download yet.

Count Lineage is coming to Claude Desktop in the next few weeks. Leave your work email and we'll send you the download the day it's ready.

Where should Lineage go after Claude? Optional

One email when it's ready. No newsletter.