Home › Prompt examples › Data analysis AI prompts: 23 copy-ready examples

Data analysis AI prompts: 23 copy-ready examples

23 prompts from 7 data analysis guides, ready to copy into any AI chat assistant.

Replace the [brackets] with your details. Every prompt comes from one of our full guides, which also covers which tool to use, the steps and the risks. Want a prompt for something else? Use the prompt builder.

Tasks on this page

AI prompts to analyze a spreadsheet

When to use: Upload a CSV/XLSX and ask questions, get charts. Full guide: Analyze a spreadsheet

Check the data first
Here is a spreadsheet of [what it contains]. Before analysing, tell me: the number of rows, each column and its type, missing values, and anything that looks wrong (duplicates, odd dates, text in number columns).
Answer one question
Using this file, answer: [question]. Show the steps or code you used, the exact filters, and the final number. If the data can't answer it, say so.
Explain a change
Compare [period A] with [period B] for [metric]. List the 3 biggest changes, by how much, and which rows drive them. Then suggest one chart that shows it clearly.
Give me a formula to check it
Write the Excel or Google Sheets formula (SUMIFS, COUNTIFS or a pivot setup) that reproduces your answer, using my column names, so I can verify it in the original file.

AI prompts to write an Excel formula

When to use: Get or explain formulas for your sheet. Full guide: Excel formula help

Write a formula
In [Excel / Google Sheets], column A has [what], column B has [what], headers in row 1. In column C I want [result]. Example: for row 2 the answer should be [value] because [reason]. Give the formula for C2 and explain it.
Explain an inherited formula
Explain this formula step by step in plain English, as if to a beginner, and tell me what happens if a cell it uses is blank:

[paste formula]
Fix an error
This formula shows [#N/A / #VALUE! / wrong number] in row [N]. Here is the formula and what's in the cells it uses: [details]. Explain why and give a corrected version.

AI prompts to clean messy data

When to use: Normalize names, dates and duplicates with code execution. Full guide: Clean messy data

Clean with rules
Clean the attached file. Rules: dates to YYYY-MM-DD (source dates are [day-first / month-first]); trim spaces; company names in Title Case; flag (don't delete) possible duplicates where [rule]. Report rows in/out and a sample of 10 changed rows.
Profile first
Before changing anything, profile this file: column types, blanks per column, odd values, likely duplicates and date formats you see. Ask me how to handle each problem.
Reusable script
Write a [Python pandas / Excel Power Query] script that applies these cleaning rules to a file with the same columns: [rules]. Add comments so I can rerun it monthly.

AI prompts to build a dashboard

When to use: Turn data into a dashboard or interactive artifact. Full guide: Build a dashboard

Build it
From the attached data, build a simple dashboard answering: [questions]. One chart per question, a one-line takeaway under each, and a table of the exact numbers used.
Sanity-check
For each chart, explain the aggregation used, any rows excluded and whether the axis starts at zero. Flag anything that could mislead.
Make it repeatable
Give me the code or spreadsheet formulas to rebuild this dashboard next month from a file with the same columns.

AI prompts to write data analysis code

When to use: Generate pandas/SQL notebooks you can rerun. Full guide: Write analysis code

Write the analysis
Write [pandas / SQL] code to answer: [question]. Data: [columns and types]. Print row counts after each filter or join, and comment each step.
Check my code
Review this analysis code for mistakes: wrong joins, silently dropped rows, wrong aggregations. Explain each issue in plain English.

[code]
Make it reusable
Turn this notebook into a script that takes the file path and month as arguments and writes the result to CSV. Add basic checks that fail loudly if columns are missing.

AI prompts to set up a scheduled data report

When to use: Automatically pull data and email a summary on a schedule. Full guide: Scheduled data report

Main prompt
n8n: weekly cron → query DB → AI summary → email team.
Beginner-friendly
n8n: weekly cron → query DB → AI summary → email team.

I'm new to this: explain each step in plain words and ask me for anything you need before starting.
Check-your-work
n8n: weekly cron → query DB → AI summary → email team.

When you finish, list any assumptions you made, anything you're unsure about, and what I should double-check before using the result.

AI prompts to write an Excel macro

When to use: Describe a repetitive spreadsheet chore and get a VBA macro or Google Apps Script, with each step explained. Full guide: Write an Excel macro or Apps Script

Macro
Write an Excel VBA macro for this task. Sheet: [name]. Columns: [A: Date, B: Client, ...]. Steps: [describe]. Requirements: add comments to every block, don't delete anything without asking with a message box, and stop with a clear message if the sheet or column isn't found. Then list every line that changes or deletes data.
Apps Script
Write a Google Apps Script for Google Sheets that [task]. Explain how to add it in Extensions > Apps Script, what permissions it will ask for, and how to run it from a custom menu.
Fix an error
My macro stops with this error: [error text] on this line: [line]. Here is the full macro: [paste]. Explain the cause and give a corrected version.
Explain a macro
Explain what this macro does, step by step, in plain English, and flag anything risky (deleting, overwriting, sending email, connecting to the internet): [paste]

More prompt examples

All prompt examples · Writing & editing · Coding · Research · IT ops & DevOps · Customer support · Automation & agents · Image & video · Personal productivity · Education & learning · Marketing · Sales · HR & recruiting · Finance & accounting · Legal & compliance · Healthcare admin · Cybersecurity · Product & design · Personal life & home · Travel · Content creation · Small business

See also: Best AI tools for data analysis

Report an error on this page