Prompt InsightsOpen Prompt Builder

Data Analysis // ChatGPT

ChatGPT Prompts for Data Analysis: 15 Templates for CSV, Excel and SQL (2026)

Updated · 15 prompts

These are the best ChatGPT prompts for data analysis in 2026, written for the version of the job where you upload a file and work on it: profiling an export before you trust it, cleaning it, writing the Excel formula or the pandas, running an A/B readout or a cohort table, picking a chart that shows the finding, and turning the result into a one-page decision. Each prompt asks for the code and the assumptions alongside the answer, because an analysis you cannot reproduce is not an analysis.

The practical habit that separates useful output from confident nonsense: never let ChatGPT analyze a description of your data. Upload the file, ask it to profile the file first, and read that profile before you ask a single analytical question. Half the wrong answers in this workflow come from a date column stored as text, a currency column with symbols in it, or duplicated rows from a re-run export, and all three show up in the profile in about ten seconds.

Which prompt for which job

  • You just got a file: profile it, then clean it. Nothing else until the profile looks right.
  • You live in a spreadsheet: the formula writer and the pivot specification, in that order, so the pivot is built on columns you trust.
  • A test finished: the A/B readout for experiments, the statistical test picker for anything that is not a clean two-variant split.
  • A number moved: the anomaly hunt to find when, the driver decomposition to find which segment, and the analysis checker before you tell anyone.
  • Someone wants next quarter's number: the forecast prompt, which insists on a range and a backtest.
  • You need to explain it: the regression readout for relationships, the chart prompt for the finding, the one-pager for the decision.

A weak prompt, and the same prompt fixed

The most common data analysis prompt is also the least useful one: "Here is my data, find insights." ChatGPT will produce a tidy list of observations, most of them restating the column summaries, and you cannot tell which ones survive scrutiny. Compare it with a version that does the work:

I uploaded subscriptions.csv (one row per subscription, columns: user_id, plan, start_date, cancel_date, mrr, country).
Question: did monthly churn get worse after the July price change, and if so, for which plans?
Rules: churn = subscriptions cancelled in a month / active at the start of that month. Compare May-June with August-September. Exclude internal test accounts (country = "XX").
First profile the file and stop if the date columns are not real dates. Then show churn by month and plan as a table, the code you ran, and two reasons the comparison could be misleading.

Same data, same model. The second prompt names the question, defines the metric, fixes the comparison window, and asks for the code, so the answer is a number you can reproduce rather than a paragraph you have to trust. Every template on this page is written in the second style; the brackets are where your version of these details goes.

Statistics prompts need a leash

ChatGPT is good at running statistical tests and fluent at explaining them, which is exactly the risk: it will run whatever you ask for and describe the result confidently even when the test does not fit the data. Three habits keep it honest. Ask it to recommend the test and justify it before running anything, which is what the test picker does. Ask for an effect size and an interval alongside every p-value, because a significant difference of 0.3% is rarely a decision. And ask what the analysis cannot show, since regression and forecasting answers read as causal and certain unless you make the model say otherwise. The regression and forecast prompts above build all three in.

Large workbooks are where the model choice shows. In one case study we covered, GPT-6 Astra finished a 50-tab tax workbook twice as fast as GPT-5.6 Sol, and the gain came as much from understanding what each tab was for as from raw speed. The same profile-first habit is what lets any model get that understanding: ask for a map of the sheets, what each one feeds, and which cells are inputs versus formulas before you ask a question that spans them.

For the reasoning-heavy half of the job, planning an exploration, writing SQL against a long schema, and pushing back on a conclusion, the Claude prompts for data analysis pack is the companion to this one, and the Claude prompts for coding pack covers the point where the analysis becomes a script somebody has to maintain. If the numbers are going into a channel report or a keyword readout, the ChatGPT prompts for SEO pack picks up from there, and when the file is a survey export or a set of interview notes, the ChatGPT prompts for market research pack has the coding and synthesis prompts. When a cleaning routine or a readout structure works, save it as a reusable template in Prompt Builder so the next month's file goes through the same pipeline instead of a fresh improvisation.

How to use these prompts

  1. 01

    Pick the prompt that matches your task

    Each prompt below targets one job. Choose the one closest to what you need instead of asking for everything at once.

  2. 02

    Replace every bracketed placeholder

    Swap [like this] for your real context: the product, the audience, the document, the constraints. Context is what separates a usable draft from generic output.

  3. 03

    Run it, then push back

    Read the first output critically and ask for a revision: tighter, more specific, a different angle, or with the weak assumptions named.

  4. 04

    Save the version that worked

    Once a prompt produces the output you want, keep it as a reusable template so the next run starts from your best version, not a blank box.

01

Profile an uploaded file before you analyze it

Find out what you actually have

I have uploaded [filename]. Before any analysis, profile it for me: row count, column names with inferred types, the share of missing values per column, cardinality of each categorical column, min/max/median for each numeric column, and the date range of any date column. Then list the five things about this file that would most likely break an analysis, and tell me which columns you do not trust and why. Show the code you ran.

02

Clean a messy export

Fix the export before the numbers lie to you

This file is an export from [system, e.g. Stripe, HubSpot, Shopify]. Clean it for analysis: standardize the date columns to ISO dates, coerce numeric columns stored as text, strip currency symbols and thousands separators, normalize inconsistent category labels (show me the mapping you chose before applying it), and flag exact and near-duplicate rows rather than dropping them silently. Output the cleaned file plus a short changelog of every transformation and how many rows each one touched.

03

Excel or Sheets formula writer

Get the formula right without four attempts

Write a [Excel / Google Sheets] formula that does this: [describe the result you want in plain language]. My data is in [sheet and range], with these columns: [list columns and what they contain]. Give me the formula, a one-line explanation of each part, and the two ways it will break (blank cells, text stored as numbers, ranges that grow). If a helper column would make it simpler and more auditable, say so and show that version too.

04

Pivot table specification

Decide the shape before you build it

I want to answer this question with a pivot: [question]. My columns are [list]. Specify the pivot: what goes in rows, columns, values, and filters, which aggregation to use for each value field, and how to handle blanks. Then tell me what this pivot will hide, and which second pivot I should build to check the first one is not misleading me.

05

A/B test readout

Say whether it worked, and how sure you are

Here are the results of an A/B test: [variant names, users per variant, conversions per variant, test duration]. The metric I care about is [metric]. Calculate the observed lift, the confidence interval, and the p-value, and state plainly whether this is a result I should act on. Then list the reasons this test could be wrong regardless of the statistics: sample ratio mismatch, novelty effect, insufficient duration, peeking, segment mix shift. Show your working.

06

Cohort retention table

See whether the product is actually keeping people

Build a monthly cohort retention table from this data: [describe the file or paste it, noting the user id, signup date, and activity date columns]. Show retention as both counts and percentages, cohort by cohort. Then interpret it: which cohorts are healthier, where the drop-off concentrates, and whether the trend across cohorts is improving or deteriorating. Name the one thing in this table you would investigate first.

07

Choose and build the right chart

Show the finding instead of decorating it

I want to communicate this finding: [state the finding in one sentence]. The underlying data is [describe or upload]. Recommend the chart type and explain why it beats the two obvious alternatives, then build it with clear axis labels, no chart junk, and the finding readable without a caption. If the honest chart is less impressive than the flattering one, build the honest one and tell me what the flattering version would have hidden.

08

Anomaly hunt in a time series

Explain the spike before someone asks

Here is a time series of [metric] by [day/week]: [upload or paste]. Identify the anomalies, separating real level shifts from noise and from seasonality. For each anomaly, give the date, the size relative to the baseline, and three candidate explanations ranked by how likely they are, including the boring ones like a tracking change or a data pipeline failure. Tell me what other data I should pull to distinguish between them.

09

Write and explain the pandas

Code you can hand over and defend

Write Python (pandas) that does this analysis: [describe the steps and the output you want]. My dataframe has these columns and dtypes: [paste]. Write it as readable, commented code that a colleague could modify, avoid chained assignment, and after the code explain each transformation in one line and state every assumption it makes about the data. Then show me the output on the first few rows so I can check it before running the whole thing.

10

Check the analysis I already did

A second pair of eyes before it goes out

I ran this analysis and reached this conclusion: [describe the method, the data, and the conclusion]. Review it as a skeptical senior analyst. Where is the reasoning weakest, what confounders did I ignore, is the sample adequate for the claim, and which step would a reviewer attack first? Give me a list of specific checks I can run to either strengthen or kill the conclusion, in the order you would run them.

11

Executive one-pager from the analysis

Turn the work into a decision

Turn this analysis into a one-page readout for [audience, e.g. the exec team]: [paste findings and numbers]. Structure it as the headline finding in one sentence, three supporting points with the numbers attached, the main caveat stated honestly, and a recommended decision with what would change your mind. No jargon, no chart descriptions, nothing that needs the appendix to make sense.

12

Pick the right statistical test

Stop running a t-test on everything

I want to know whether [describe the comparison, e.g. average order value differs between three regions]. The data: [describe the variables, their types, the sample size per group, and whether the same people appear in more than one group]. Recommend the statistical test, explain in two sentences why it fits and why the obvious alternative does not, list the assumptions it needs and how to check each one on my data, then run it and report the result with an effect size, not just a p-value. If the sample is too small for any test to be meaningful, say so.

13

Regression readout you can explain

Turn coefficients into a sentence a manager can use

Fit a [linear / logistic] regression of [outcome] on [predictors] using the uploaded file. Before fitting, check for missing values, obvious outliers, and predictors that are near-duplicates of each other. Report each coefficient in plain language (holding the others fixed, a one-unit change in X goes with ...), its confidence interval, and how much of the variation the model explains. Then list what this model cannot tell me: causation, effects outside the observed range, and any variable I left out that could be doing the work.

14

Simple forecast with honest uncertainty

A number for the plan, with a range around it

Here is [metric] by [week/month] for the last [n] periods: [upload or paste]. Forecast the next [n] periods using a simple, explainable method (seasonal naive or exponential smoothing before anything fancier). Show the forecast with an 80% range, the method in one paragraph, and a backtest: what the same method would have predicted for the last [3] periods against what actually happened. Flag any period in the history that looks like a one-off and say whether you excluded it.

15

What is driving the change

Split a moved number into its parts

[Metric] moved from [old value] to [new value] between [period A] and [period B]. Using the uploaded data, decompose the change: how much comes from volume versus rate, and how much from each [segment, e.g. channel, region, plan]. Separate mix effects (the segments changed size) from rate effects (the segments changed behaviour). Present it as a table that adds up to the total change, then name the one or two components that explain most of it and what I should check to confirm each.

READY TO ASCEND

Get the full pack by email

Curated prompt packs and prompt-engineering insight. No noise.

Questions

Which ChatGPT mode should I use for data analysis?

Use the mode that can run code and read uploaded files, so ChatGPT works on your actual data rather than on a description of it. The difference matters: a described dataset produces plausible-sounding reasoning, while an uploaded one produces numbers you can reproduce. Always ask it to show the code it ran so the result is auditable.

Can I upload my company's spreadsheet to ChatGPT?

That depends on your data policy, not on the model. Check whether your plan excludes your inputs from training, and strip or hash direct identifiers (names, emails, account numbers) before upload. For most analyses you only need the columns the question touches, so upload a reduced file rather than the full export.

Why does ChatGPT give me different numbers each time I run the same analysis?

Because it re-derives the approach each run: a slightly different grouping, a different null-handling choice, or a different date boundary. Pin the analysis down in the prompt (state the exact filters, the date range, how to treat nulls and duplicates), ask for the code, then rerun the code rather than the prompt. Code is repeatable; a re-asked question is not.

ChatGPT or Claude for data analysis?

ChatGPT is the stronger choice when the work is hands-on with a file: profiling an upload, writing and running pandas, building charts, producing a cleaned output you can download. Claude is the stronger choice when the work is reasoning-heavy: planning an analysis, writing and explaining SQL against a long schema, and stress-testing a conclusion. The companion pack of Claude prompts for data analysis covers that half.

How do I check that ChatGPT's analysis is actually right?

Three checks catch most errors. Reconcile one number against a source you already trust (a dashboard total, a known monthly revenue figure). Ask for the row counts at every filtering step so you can see where records disappeared. Then ask it to argue against its own conclusion and name the confounders. Anything that survives all three is usually safe to circulate.

Related prompt packs