IntermediateLesson 12 of 305 min read

Analysing Data and Tables

Learn what Claude can do with spreadsheets and tables, why arithmetic should be computed, how to ask for numbers with working, and how to check claims about data with a real program.

In this lesson you will

  • Know what Claude can do with data
  • Ask for calculations with working
  • Check numeric claims
  • Follow a routine for data work

About 22 minutes

A summary with a number that looks right

Meera exports last year’s monthly sales from the library’s book shop as a spreadsheet. She uploads it and asks Claude, ‘Summarise the trends.’ The reply says sales grew by 75 per cent from January to December, and that the best month was December. It reads well. She puts it in the annual report. A colleague checks and finds that the growth was 75.6 per cent. The difference is small, but she had said ‘exactly’ in the report. Data analysis is one of the places where Claude can save hours and also one of the places where a small slip hides inside a confident paragraph. This lesson shows how to use both: let Claude do the heavy lifting, and verify the numbers.

What Claude can do with data

  • Explain what a table or spreadsheet contains, and spot odd rows.
  • Suggest calculations and charts for a question you have.
  • Clean up messy data: fix spellings, merge columns, standardise dates.
  • Summarise patterns, such as trends, peaks and outliers, in plain English.
  • Write formulas or short programs that do the calculation for you.

In some versions, Claude can run code to do the calculations itself, which is generally more reliable than doing sums in its head. Availability depends on your plan and settings, and spreadsheets in the XLSX format may need that feature switched on, as Anthropic’s upload help notes. If your version cannot run code, ask for the formula or program and run it yourself. Either way, there is a rule worth memorising: arithmetic should be done by a calculator, not by a language model. A language model writes plausible text, and a plausible-looking number is not a computed one.

A good data prompt

The attached CSV has monthly sales for one year, with columns month and sales. Calculate the total, the average, the median, the best month, and the growth from January to December as a percentage. Show the formula you used for each. If you cannot calculate something exactly, say so.

The key phrases are ‘show the formula’, which makes the result checkable, and ‘say so’, which allows an honest gap. Ask for the working, not just the answer.

Check the numbers yourself

The program below does the checking that Meera skipped. It holds the same twelve months of data, calculates the true figures with standard tools, and compares them with five claims taken from a draft summary. Notice that the calculation is the dull, reliable part. The value is in the comparison.

import csv, io, statistics

DATA = """month,sales
Jan,410
Feb,380
Mar,455
Apr,430
May,470
Jun,520
Jul,505
Aug,490
Sep,560
Oct,610
Nov,640
Dec,720
"""
rows = list(csv.DictReader(io.StringIO(DATA)))
sales = [int(r["sales"]) for r in rows]
months = [r["month"] for r in rows]

total = sum(sales)
mean = statistics.mean(sales)
median = statistics.median(sales)
best = months[sales.index(max(sales))]
growth = (sales[-1] - sales[0]) / sales[0] * 100

claims = {                       # what a draft summary says
    "total": 6190,
    "average": 515.8,
    "best month": "Dec",
    "growth Jan to Dec": 75.0,
    "months over 500": 6,
}
actual = {
    "total": total,
    "average": round(mean, 1),
    "best month": best,
    "growth Jan to Dec": round(growth, 1),
    "months over 500": sum(s > 500 for s in sales),
}
for k, v in claims.items():
    verdict = "ok" if v == actual[k] else f"WRONG, it is {actual[k]}"
    print(f"{k}: {v} {verdict}")
print()
print("median:", median)
total: 6190 ok
average: 515.8 ok
best month: Dec ok
growth Jan to Dec: 75.0 WRONG, it is 75.6
months over 500: 6 ok

median: 497.5

Four of the five claims pass. The total of 6190 and the average of 515.8 are right, and so are the best month and the number of months over 500. The growth claim fails: the summary said 75.0, but the true figure is 75.6 per cent. The difference is small, but it is a difference, and it came from rounding or approximating by eye. The median of 497.5 was not claimed by the summary, but it is worth noticing: it is lower than the average of 515.8, which tells you that a few big months, at the end of the year, pull the average up. That kind of observation, the shape of the data, is where Claude is helpful, and the numbers are where you check.

A routine for data work

  1. Look at the data first. Open the file and glance at the columns, the rows and anything strange.
  2. Tell Claude what each column means, in a sentence each.
  3. Ask for the calculation and the working, and run the formulas or code yourself where you can.
  4. Compare the key numbers with a quick calculation of your own, such as a spreadsheet total.
  5. Ask Claude to point out anything unusual, then check each point.
  6. Write conclusions in your words, and keep the numbers you verified.
Common mistake: trusting the story about the data

Trusting a chart or a trend description without looking at the data. A summary can overstate a trend, hide an outlier or mix up two columns. Always see at least a few rows of the real data next to the claim.

Private data

Data can contain private information. Before you upload a spreadsheet of customers or staff, remove names, addresses and anything else you do not need, as lesson 9 explained.

Export a small spreadsheet you know. Ask Claude for five facts about it, with the formula for each. Check each against your own calculation. Which one, if any, was off, and by how much?

Practice for this lesson

Check what you learned

Five quick questions. Pick an answer and you will see straight away whether it is right and why.

Who should do arithmetic in data work?

  1. Only the language model
  2. A calculator or code, not a language model
  3. Nobody
  4. A guess

Calculations should be computed, because a plausible-looking number is not necessarily correct.

Why ask for the formula used?

  1. It makes the reply shorter
  2. It hides errors
  3. It makes the result checkable
  4. It changes the data

With the working shown, you can verify how a number was produced.

Which claim failed the check?

  1. Growth from January to December
  2. The total
  3. The best month
  4. Months over 500

The summary said 75.0 per cent, but the true figure is 75.6.

What does a median lower than the average suggest?

  1. The data is wrong
  2. There is no trend
  3. A few large values pull the average up
  4. The median is broken

A small number of very high months can raise the average above the typical month.

What should you do before uploading customer data?

  1. Remove details you do not need
  2. Add more details
  3. Post it publicly
  4. Rename the file

Removing unnecessary private details protects the people in the data.

Summary

  • Let Claude explain, clean and suggest, but have numbers computed.
  • Ask for the formula and for an honest “I cannot calculate that”.
  • Compare key claims with your own calculation.
  • Remove private details before uploading data.

Next lesson

Lesson 13 looks at step-by-step reasoning and checking maths.

Questions

Can Claude work with spreadsheets?

Yes, with supported file types. XLSX files may need code execution and file creation to be enabled, according to Anthropic's help. If it is not available, export a CSV.

Is Claude good at maths?

It can explain methods well, but long calculations are safer when done by code or a calculator. Always check important numbers.

How do I make a chart?

Ask for a chart description or a short program that draws it, and check the numbers shown. In some versions Claude can draw charts itself.

Progress is saved in this browser.