AIAI Academy

Module 2: Uses · 3 min read

Data Analysis with AI: From an Excel File to Insight Without Writing Code

How chatbots analyze files using code they write and run, and how to make sure the numbers are right.

In the lesson on generative vs. predictive AI we saw that a language model isn't built for calculation. So how do chatbots analyze tables with thousands of rows? They don't calculate in their heads. They write code (usually in Python), run it on your file, and show the result.

That's the critical difference: when the model runs code, the numbers are actually computed. When it "estimates" without code, they may be made up.

What you can do

  • Data cleaning: merging columns, fixing dates, removing duplicates.
  • Summaries: sales by month, top customers, averages by category.
  • Charts: "Show the revenue trend over the last 12 months."
  • Finding outliers: "Which orders look unusual in amount or frequency?"
  • Formulas: "Write me an Excel formula that calculates a tiered commission based on this table."

How to frame the request

OpenAI's guide to data analysis recommends starting from the decision you're trying to make, not from the data. A simple template:

I'm trying to decide ___, based on ___. Attached is the 2025 sales file. The "Status" column indicates whether the order was cancelled. First give an initial overview of the data and 3 hypotheses to test, and only then the analysis.

Three things make the difference:

  1. Explain what each column means, especially when the names aren't clear.
  2. Ask for a method before an answer. That way you'll see whether the model understood the question.
  3. Ask to see the code, or at least an explanation of the calculation.
🎬 10X Your Excel Skills with ChatGPT · Kevin Stratvert

How to make sure the result is correct

  • Sanity check: does the total match what you know? If your annual revenue is a million dollars and the analysis shows ten million, something broke.
  • One manual check: calculate one number yourself in Excel and compare.
  • Ask what was removed. Models sometimes quietly filter out "problematic" rows. Ask for a report on every row excluded from the analysis.

Three common mistakes

  1. False causation: "Sales rose after the campaign" doesn't mean the campaign caused the rise. The model will happily tell a story. Ask it for alternative explanations too.
  2. Partial data: if the file covers only half a year, don't ask for an annual trend.
  3. Sensitive information: a customer file with names, phone numbers and ID numbers shouldn't be uploaded as is. Remove or mask identifying columns before uploading, as explained in the lesson on privacy.

Bottom line: AI turns anyone who can ask a good business question into a basic analyst. The power comes from code that runs on the data, and your responsibility is to define the question and check the answer.

Sources

Read next