The short answer
The best AI prompts for data analysis describe what each row means, ask one clear question and demand the code, formula or query behind every number. This page has 12 such prompts for cleaning, exploring, SQL, statistics, charts and findings. ChatGPT and Claude both run code on uploaded files (Claude does on its free plan), and Microsoft Copilot in Excel edits workbooks directly for licensed users.
| Prompts on this page | 12, in four groups |
|---|---|
| Runs code on your file | ChatGPT (plan-dependent limits), Claude (all plans including Free) |
| Works inside Excel | Microsoft Copilot in Excel, with a qualifying Microsoft 365 or Copilot plan |
| Golden rule | No code or formula shown means the number is unverified |
What AI is good at in data analysis, and where it fails
AI assistants that can run code are now genuinely useful analysts' helpers. When you upload a CSV or spreadsheet to ChatGPT or Claude, the assistant writes and runs code against the real file, so the numbers come from a calculation, not from the model guessing. That is the single most important thing to check: if the tool did not run code or a formula, treat any number it gives you as unverified.
Where AI helps most: cleaning messy exports, profiling a new dataset, writing SQL and spreadsheet formulas, choosing and drawing charts, and turning results into plain-English findings. Where it fails: knowing what your columns really mean, knowing which rows are test data, and deciding what a result implies for the business. Those need you.
Every prompt below follows four rules that make analysis output checkable:
- Describe the data. What one row represents, what the key columns mean, the date range and any known problems.
- State the question and the decision. "Which region should get extra budget?" is better than "analyse this".
- Demand the working. Ask for the code, formula or query it used and for row counts before and after every filter.
- Ask for caveats. Sample size, missing data, outliers and whether a pattern could be chance.
Prompts for cleaning and preparing data
Most analysis time goes on preparation, and it is where silent errors start. The Profile a new dataset prompt gets a health check before you trust anything: row counts, types, blanks, duplicates and suspicious values. The Clean an export without losing rows prompt asks the assistant to log every change and report how many rows each step touched, so nothing disappears unnoticed. The Merge two files safely prompt checks for unmatched keys, which is the most common reason a joined table has the wrong total.
Prompts for exploring and analysing
Once the data is clean, start broad and then test. The Find what changed and why prompt breaks a headline change into its drivers, the Segment customers from transactions prompt builds simple, explainable groups rather than a black-box model, and the Check if a difference is real prompt asks for an appropriate statistical test and a plain-English answer about whether the result could be noise. If the assistant picks a test, ask it why that one, and what assumption would break it.
Prompts for SQL, formulas and code
Writing queries is where AI saves analysts the most typing. The Write a SQL query from a schema prompt only works if you paste the real table and column names, and asking for comments on each step makes review faster. The Explain a formula or query someone else wrote prompt is the best way to inherit a spreadsheet or dashboard without breaking it. If you work in Excel, Copilot in Excel can now build formulas, PivotTables and charts directly in the workbook; we cover that in Copilot prompts for Excel.
Prompts for charts and presenting findings
A finding nobody understands is not a finding. The Choose the right chart prompt asks for one chart per message with the reason, not a dashboard of everything. The Write findings for a busy executive prompt puts the answer first, gives the evidence second and lists caveats plainly. The final prompt, Audit an analysis before you share it, asks the model to check your own work for the classic mistakes: wrong denominators, double counting and survivorship bias.
How to adapt these prompts
- Paste a data dictionary. Even five lines ("order_value is in euros including VAT; status 9 means test order") prevents most wrong answers.
- Share a sample, not everything, when data is sensitive. Remove names, emails and IDs, or upload a few hundred anonymised rows to design the method, then run the final analysis inside your own systems.
- Keep the chat going. Ask follow-ups in the same conversation so the assistant keeps the cleaned data and earlier steps.
- Re-run the key number yourself. Before anything goes into a report, recompute the headline figure with a formula or query you control.
Which AI tool works best for data analysis
ChatGPT is the easiest starting point: data analysis is on its plans with limits that depend on the plan, and uploads are limited on Free. Claude runs code and creates files on every plan including Free, and Claude Dashboards (beta) on Pro and above can chart data from connected apps with each chart showing its query and last refresh. If your data lives in Excel at work, Microsoft Copilot in Excel edits the workbook itself, which keeps formulas visible to colleagues. For a longer comparison, read best AI for data analysis, best AI for spreadsheets and how to use AI for Excel.
Customer and financial data deserve care. On personal accounts, switch off training first (ChatGPT: Settings, Data controls, Improve the model for everyone; Claude: Settings, Privacy, Help Improve our AI models), and prefer your company's ChatGPT Business, Claude Team or Microsoft 365 Copilot plan, which do not use your content for training by default.
Prompts to copy
Profile a new dataset
I have uploaded [file name]. Each row is one [order, customer, visit]. Before any analysis, run code to profile it: number of rows and columns, the data type of each column, blanks per column, duplicate rows, the range of every numeric and date column, and the ten most common values of each text column. List anything that looks wrong, such as negative prices or future dates, and do not change the data yet.
You get: A health check of the file before you trust it
Clean an export without losing rows
Clean [file name] for analysis. Rules: [standardise country names, convert dates to YYYY-MM-DD, trim spaces, treat "N/A" as blank]. Do not delete any rows; add a column called issue that explains anything you could not fix. After each step, report how many rows changed. Give me the cleaned file to download and the code you used.
You get: A clean file plus a log of every change
Merge two files safely
Join [file A] and [file B] on [key column]. Before joining, tell me how many keys appear in A only, B only and both, and show five examples of keys that do not match. Then do a [left] join, report the row count before and after, and flag any key that matched more than one row.
You get: A joined table with the mismatches exposed
Find what changed and why
Using [file name], compare [metric] between [period 1] and [period 2]. Break the change down by [region, product, channel] and show which segments drove most of it, as a table of contribution to the total change. Then list three possible explanations I should check, saying which data would confirm or rule out each one.
You get: The drivers behind a headline change
Segment customers from transactions
From these transactions [file name], build customer segments using recency, frequency and spend. Use simple, explainable rules rather than a clustering model. For each segment give the rule, number of customers, share of revenue and one suggested action. Show the code and the cut-off values so I can change them.
You get: Explainable customer groups with actions
Check if a difference is real
Group A had [result] from [sample size] and group B had [result] from [sample size]. Choose an appropriate statistical test, explain why in two sentences, run it, and tell me in plain English whether the difference is likely to be real or could be chance. State the assumptions behind the test and what sample size I would need to be confident.
You get: A plain-English answer on significance
Write a SQL query from a schema
Write a [PostgreSQL, BigQuery, Snowflake] query. Tables and columns: [paste schema]. Question: [question, such as monthly active customers by plan for the last 12 months]. Comment every step, state any assumption about the data, and add a second query that checks the result, such as a row count or total I can compare.
You get: A commented query plus a sanity check
Explain a formula or query someone else wrote
Explain this [Excel formula or SQL query] step by step in plain English: [paste it]. Tell me what it returns, what inputs it depends on, where it could break (blanks, text in number columns, duplicates), and suggest a simpler version if one exists.
You get: Understanding of inherited work before you touch it
Build a forecast with honest uncertainty
Using monthly [metric] in [file name], build a simple forecast for the next [number] months. Try a seasonal naive method and one other method, compare their error on the last six months, and use the better one. Show a range, not just one line, and explain in two sentences what would make the forecast wrong.
You get: A forecast with a range and its weak points
Choose the right chart
I want to show [message, such as churn rose only in the starter plan] to [audience]. The data: [describe columns]. Recommend one chart, explain why it fits better than two alternatives, then draw it with a title that states the finding, labelled axes and no unnecessary colours.
You get: One chart that makes one point clearly
Write findings for a busy executive
Turn this analysis into a note for [executive role]: [paste results]. Start with the answer to [question] in one sentence, then three supporting points with numbers, then caveats in one short list, then the decision or next step I recommend. Under 200 words, no jargon, and do not overstate certainty.
You get: An answer-first summary leaders can act on
Audit an analysis before you share it
Review this analysis as a sceptical senior analyst: [paste method, code and results]. Check for wrong denominators, double counting, filters that remove important rows, survivorship bias, mixing time periods and confusing correlation with cause. List each problem you find with how to fix it, and say which headline number you would recompute first.
You get: A pre-publication check for classic mistakes