How to Analyze a CSV or Spreadsheet With AI

Quick answer: Keep the original file unchanged, define the question you need answered, and inspect the columns before asking for conclusions. Let code or spreadsheet formulas produce the numbers; use AI to explain patterns, exceptions, and next questions. The finished result should include the calculation method, filtered row counts, missing-data notes, and a table or chart you can check against the source.
The goal is not “ask AI what this spreadsheet says.” The goal is a small, reproducible analysis that another person can review.
Start with a business question, not the whole file
A spreadsheet can support many conclusions. Choose one decision first:
- Which products declined after a price change?
- Which invoices are overdue, and by how many days?
- Which support categories grew month over month?
- Which campaigns generated qualified leads rather than only clicks?
- Which rows need human review because required fields are missing?
Write down the expected artifact too. A useful request is “create a weekly sales brief with a summary table, three findings, exceptions, and the formulas used.” “Analyze this data” leaves the output and stopping condition undefined.
Preserve the original and record its shape
Work on a copy. Before changing values, create a short data profile:
| Check | Record |
|---|---|
| File and sheet | Exact filename and worksheet |
| Snapshot | Export date or source-system timestamp |
| Size | Row and column count |
| Key | Column expected to identify one record |
| Types | Text, date, number, currency, category |
| Missingness | Blank count for important columns |
| Duplicates | Duplicate keys or repeated rows |
| Scope | Filters, excluded rows, and time period |
CSV import deserves special attention. Spreadsheet software can interpret dates, long numbers, and identifiers automatically. Microsoft documents that opening a CSV with default settings can change date interpretation or remove leading zeros from values intended as text. Import deliberately and check identifiers such as account numbers, postal codes, and SKUs before analysis.
Ask for a plan before calculations
For a monthly revenue question, a good plan might be:
- identify the date, amount, status, and account columns;
- exclude cancelled rows and list how many were excluded;
- parse dates and report failures;
- group completed revenue by calendar month;
- calculate month-over-month change;
- list the five accounts that explain the largest change;
- create a summary table and a chart;
- reconcile the grouped totals to the included source rows.
Review that plan before the tool runs. A correct calculation for the wrong definition is still the wrong answer.
Make calculations reproducible
Use spreadsheet formulas, Power Query, SQL, or a script for arithmetic and grouping. Keep the generated formula or code with the result. AI can write and explain that logic, but the recorded operation—not a sentence generated from memory—should be the calculation of record.
A useful analysis folder might contain:
source/
sales-export-2026-07.csv
analysis/
profile.md
clean-and-summarize.py
monthly-summary.csv
exceptions.csv
findings.md
The original stays in source/. Derived data and explanations stay separate.
Require an analysis register
Ask the agent to make each finding checkable:
Illustrative example: The figures below show the structure of an analysis register, not results from a recorded Agenaxy run or customer dataset.
| ID | Finding | Calculation | Rows / filter | Evidence artifact | Confidence |
|---|---|---|---|---|---|
| F-01 | July revenue fell 8.4% | Jul / Jun - 1 |
Completed orders only | monthly-summary.csv |
High |
| F-02 | Two accounts explain most of the decline | Difference by account | Same scope | account-change.csv |
High |
| F-03 | Missing region values may distort the regional view | Blank count | 37 rows | exceptions.csv |
Medium |
This separates measured findings from explanations and data-quality caveats.
Use a bounded work order
Outcome:
Create a reviewable monthly sales brief from the selected CSV.
Source rules:
Do not edit the original. Record filename, row count, columns, inferred types,
missing values, duplicate keys, and import problems before calculating.
Definitions:
Revenue = amount for rows whose status is Completed.
Use calendar month from completed_at. Do not guess missing dates or amounts.
Artifacts:
profile.md, monthly-summary.csv, exceptions.csv, findings.md, and the script
or formulas used to create them.
Done:
Included and excluded row counts reconcile to the source row count.
Every numeric finding links to a generated table and calculation.
Check the result in four passes
1. Scope
Confirm the date range, filters, currency, units, time zone, and definition of each metric.
2. Data quality
Review blank values, parsing failures, duplicate keys, unexpected categories, and outliers. Microsoft Power Query's data-profiling tools similarly distinguish valid, error, empty, and unknown values and show distributions; the useful principle is to inspect quality before interpreting a chart.
3. Arithmetic
Recalculate a few totals manually or with a second method. Check that percentages use the intended denominator and that grouped totals reconcile to the included rows.
4. Interpretation
Make sure the explanation does not turn correlation into cause. A decline after a price change may be related, but the spreadsheet alone may not prove why it happened.
When AI is the wrong tool
Use a fixed spreadsheet template instead when the same clean data always produces the same report and no interpretation is required. Ask a data specialist for help when the file is too large for the chosen tool, joins across systems are unclear, or a financial, legal, or regulated decision depends on the result.
Where Agenaxy fits
Agenaxy is a local-first AI agent workbench for file-based work. You can keep the selected spreadsheet, instructions, generated code, tables, and narrative in one workspace instead of copying fragments through chat. Activity exposes the work performed, while Artifacts hold editable results.
Standard can use a selected local or cloud model. A remote model receives the context sent to it. In Vault, every model Connection must be explicitly authorized; tools and scripts stay within approved files and folders, and agent-run scripts are blocked from network access.
Continue with how to use AI with a folder of files or how to write instructions an AI agent can follow.
Try one spreadsheet task
Describe a non-confidential spreadsheet, the decision it supports, and the artifact you want in Try Agenaxy. Do not submit the file, credentials, customer records, or production data through the form.
FAQ
Can AI analyze an Excel file directly?
Some tools can read XLSX files; others work more reliably with a clean CSV export. Confirm which sheets, formulas, formatting, merged cells, and hidden rows the chosen tool can actually inspect.
Should AI calculate the totals itself?
Use recorded formulas or code for the totals. AI can generate that logic and explain its result, but keep the executable calculation so another person can reproduce it.
What is the safest first spreadsheet task?
Choose a copied, non-confidential export with a clear question and a result you can verify against a pivot table or a few manual calculations.
Sources and Fact-Checking Notes
- Microsoft — Import or export text and CSV files documents delimiter choices and automatic type interpretation, including dates and leading zeros.
- Microsoft — Power Query data-profiling tools documents column quality, distribution, and profile views.
- The analysis register and reconciliation method are editorial workflow guidance, not a claim that one AI product guarantees analytical correctness.
- Agenaxy product statements are checked against
agenaxy/apps/site/public/llms-full.txtand ADR-066.