Business Intelligence
How to Use ChatGPT for Excel Data Analysis
Three ways to use ChatGPT for Excel analysis compared, with prompts for formulas, cleaning and VBA, plus security rules and when to stop exporting files.
There are three practical ways to use ChatGPT for Excel data analysis: describe what you want and paste the formula or VBA it writes back into your sheet, upload the file and ask ChatGPT to analyse the data directly with its code-execution tools, or install an add-in so GPT functions run inside cells. For everyday work — writing formulas, debugging a broken VLOOKUP, standardising date columns, summarising a table — the first method is fastest and keeps your data out of the model entirely.
Whichever route you take, two rules apply: strip personal and commercially sensitive data before uploading anything, and verify every generated formula on a small sample before applying it to a full sheet. ChatGPT is very good at Excel syntax and occasionally confident about functions that do not exist in your version.
Three Ways to Connect ChatGPT and Excel, Compared
Method | How it works | Best for | Data exposure | Setup effort |
|---|---|---|---|---|
Copy-paste formulas | Describe the task in chat, paste the returned formula or VBA into Excel | Formulas, macros, debugging, explaining someone else's spreadsheet | None, if you describe columns without pasting rows | None |
Upload and analyse | Attach the file; ChatGPT runs Python over it and returns findings and charts | Exploratory analysis, cleaning messy files, quick statistics | The file contents leave your machine | None, but requires a plan with file analysis |
Add-in with GPT functions | An add-in exposes functions that call the API from inside cells | Bulk text tasks: classification, summarising, tidying free-text columns | Cell values are sent to the API per call | Add-in install plus an API key, and per-call cost |
Method 1: Ask for the Formula, Paste It In
This is the workhorse. The trick is to describe your sheet precisely rather than pasting data. A good prompt names the columns, states the goal, and specifies the Excel version.
In Excel 365, column A has order dates as text in the format DD/MM/YYYY, column B has revenue, and column C has a region name. Write a formula for cell F2 that sums revenue for the region in E2 for the most recent complete calendar month. Explain what each part does.
Three habits make this dramatically more reliable:
State your Excel version. XLOOKUP, LET, LAMBDA and dynamic array functions are not available everywhere. If the formula comes back with a spill error or an unrecognised name, say "rewrite this using only functions available in Excel 2016" and it will.
Ask for an explanation. You are going to own this formula. A one-line explanation per nested function is the difference between a maintainable sheet and a cursed one.
Paste errors back verbatim. "Excel says #VALUE! and my dates are left-aligned" is enough for it to diagnose text-formatted dates.
Debugging is where this method earns its keep. Paste a broken nested IF or a VLOOKUP returning #N/A, describe what you expected, and ask what is wrong. It will usually spot the unsorted range, the wrong column index, or the trailing space before you do. More formula-specific patterns: using ChatGPT for Excel formulas.
Method 2: Upload the File and Let It Analyse
ChatGPT's file-analysis capability runs real Python over your spreadsheet: it can profile columns, find outliers, pivot, join two sheets, and produce charts. File upload and code execution are available in ChatGPT's paid tiers — check your current plan's documentation for limits on file size and row counts.
What it handles well:
Profiling an unfamiliar file — column types, null counts, distinct values, obvious anomalies.
Cleaning tasks that are tedious in Excel: splitting inconsistent name fields, normalising country codes, reconciling two exports with slightly different keys.
Statistical work Excel makes awkward — correlation matrices, regressions, cohort tables.
Producing a cleaned file back, which you download rather than rebuild.
What to watch: very large workbooks may be truncated or time out, and multi-sheet files with formulas can lose the formula logic on import. Always ask it to state row counts before and after any filtering step — that single habit catches most silent data loss. And never upload a file containing customer PII, salary data, or anything under contractual confidentiality without checking your organisation's policy first. If your real goal is analysing warehouse data, doing it without exporting a file at all is safer and faster.
Method 3: GPT Functions Inside Cells
Add-ins such as GPT for Excel expose spreadsheet functions that call the OpenAI API directly from a cell, so you can fill a column by dragging. This is the right tool for one specific job: applying a language task to hundreds of rows.
Classifying free-text support tickets into categories.
Extracting a company name from a messy "notes" field.
Summarising long survey responses into one line each.
Standardising job titles or product names for grouping.
Two cautions. First, every cell is an API call, so a 5,000-row column is 5,000 calls — check the pricing before dragging the fill handle. Second, results are non-deterministic; recalculating can change values. Convert the output to static values (paste special) once you are satisfied, or your workbook will quietly shift under you.
What Excel's Own AI Already Does
Before adding anything, check what is already in your ribbon. Excel ships useful automation that many people never open.
Analyze Data (formerly Ideas) generates summaries, trends and suggested pivot charts from a formatted table, and accepts natural-language questions about the range.
Forecast Sheet produces a forecast with confidence bounds from a date column and a value column, using exponential smoothing. For seasonal series it is genuinely decent and takes one click.
Flash Fill infers text transformations from two or three examples — still the fastest way to split or reformat a column.
Copilot in Microsoft 365, where licensed, works against your workbook natively rather than through copy-paste, which removes the version-mismatch problem.
These require your data to be in a proper Excel table with clean headers, no merged cells, and no blank rows — the same prerequisites that make ChatGPT's answers better.
Practical Recipes
Standardising a Date Column
Ask: "Column A contains dates in mixed formats — some DD/MM/YYYY text, some real dates, some blank. Give me a formula that returns a proper date serial or an empty string, and tell me how to spot the rows it cannot parse." The follow-up matters as much as the formula: you want the failures listed, not silently blanked.
Removing Duplicates by Business Rule
"Rows are duplicated by email, but I want to keep the most recent by signup date." Ask for both an approach using Remove Duplicates after sorting and a formula-based flag, then check the row count difference before deleting anything.
Building a Summary Without a Pivot Table
SUMIFS, COUNTIFS and dynamic array functions like UNIQUE and FILTER can produce a live summary block that updates automatically. Describe the layout you want — "region down the left, months across the top, revenue in the body" — and ask for a spill-range approach.
Writing a Macro
VBA is a good use case because it is verbose, tedious, and well documented in training data. Describe the steps in order, ask for commented code, and test on a copy of the workbook. Always ask it to include a line that turns screen updating back on, and never run generated VBA on a file you have not backed up.
Charts
ChatGPT can tell you which chart suits a comparison and walk you through building it, but it cannot format your workbook for you unless you are using an integrated Copilot. For chart selection, the walkthrough here is quicker than prompting from scratch.
Writing Prompts That Produce Working Formulas
Name cells and ranges explicitly. "Column D" beats "the revenue column".
Say what should happen in edge cases. Blank cells, zero divisors, text in a numeric column — otherwise you get a formula that breaks on row 4,000.
Give one example of input and expected output. This resolves more ambiguity than a paragraph of description.
Ask for the simplest version first. Then ask it to make the formula robust. Starting with "robust" produces unreadable nesting.
Iterate rather than restarting. "Nearly right, but it counts refunds twice" gets you there faster than a fresh prompt.
Security and Accuracy Rules
Describe your data instead of pasting it when the task is formula generation. Column names are enough.
Anonymise before uploading: remove names, emails, account numbers, and anything covered by a customer contract.
Check your organisation's policy on consumer AI tools. Business and enterprise tiers have different data handling terms than free ones.
Validate every formula against a manually calculated subset of ten rows before applying it to the sheet.
Sanity-check magnitudes. A number that is off by a factor of the number of rows usually means a join or a filter went wrong.
Keep a copy of the original file. Always.
When to Stop Exporting to Excel Altogether
Every workflow above starts with a file, and the file is a snapshot. If you find yourself re-exporting the same report weekly, or if two colleagues produce different totals because they exported on different days, the spreadsheet has stopped being the tool and started being the problem.
The alternative is to ask questions against live data instead. Querio connects live and read-only — no extracts — to Snowflake, Google BigQuery, Amazon Redshift, ClickHouse, MotherDuck, PostgreSQL, MySQL, MariaDB, Microsoft SQL Server, and MongoDB, and answers plain-English questions with real SQL and Python in a reactive notebook you can inspect. Definitions like "active customer" live as version-controlled files in your own GitHub repository, so everyone's number matches. Recurring reports become automations delivered to Slack or email rather than a Tuesday-morning export. It answers only from what is in the data, and says so when the data is not there.
Spreadsheets remain excellent for genuinely ad-hoc work. The line to watch is when a spreadsheet becomes the only place a company definition exists.
FAQs
Is it safe to upload a business spreadsheet to ChatGPT?
It depends on the data and your plan. Consumer and business tiers have different data-handling terms, and many organisations prohibit uploading customer data to external AI tools. The safe default is to describe the structure and paste no rows; if you must upload, anonymise identifiers first.
Why does ChatGPT sometimes give a formula Excel rejects?
Usually a version mismatch — XLOOKUP, LET, TEXTSPLIT and dynamic arrays are not in older builds — or a locale issue where your Excel expects semicolons rather than commas as argument separators. Tell it your version and region and ask for a rewrite.
Can ChatGPT read an entire large workbook?
Not reliably. Large files may be truncated, and multi-sheet workbooks with cross-sheet formulas often lose the formula logic on import. For big files, either analyse one sheet at a time or move the analysis to a database.
How do I clean data with ChatGPT without breaking it?
Work on a copy, ask for row counts before and after every filtering step, and ask it to list the rows it could not parse rather than dropping them silently. Handling of nulls specifically is worth reading up on: how to handle missing data.
Should I use ChatGPT or Excel's built-in Copilot?
If you have a Copilot licence, it works directly on your workbook and avoids copy-paste and version mismatches. ChatGPT is more flexible for explanation, VBA generation, and analysis that goes beyond the sheet — and it is available to everyone. Many people use both.
Watch
Sources and further reading
Related reading

