AI prompt templates for data analysis turn broad requests into specific, checkable tasks. A useful template identifies the dataset, research question, method, expected output, and validation requirements. It helps organize the work; accuracy still depends on suitable data, correct calculations, and informed judgment.

Quick answer

Use structured prompts for cleaning, scaling, summaries, charts, trends, regression, category comparisons, clustering, correlation, sentiment, forecasting, and reporting. Ask for executable code or formulas, visible assumptions, and checks. A generated explanation does not demonstrate that the calculation was executed.

Reviewed 19 October 2026. These are adaptable templates, not measured guarantees of model performance. Replace bracketed fields before use. If a system cannot read the file or execute calculations, request reproducible Python, R, SQL, or spreadsheet instructions instead of accepting invented results.

Before you start: define and protect the data

Preserve the original file. Define what each row represents, identify key fields, document units and date formats, and create a short data dictionary. Check missing values, duplicates, and inconsistent categories before analysis. Specify the question, relevant columns, output format, and review criteria.

For broader instruction design, see AOFIRS’s guide to prompt engineering for researchers. Its report on data analysis for researchers provides related methodological context.

Use an approved processing environment for confidential data. Check organizational policies, provider terms, retention, and access controls. Remove unnecessary identifiers; removing names alone does not guarantee anonymity.

Six-stage AI analysis workflow: define, inspect, execute, validate, visualise and report
Preserve the original data and validate calculations before turning results into charts or reports.

12 AI prompt templates for data analysis

Use one task at a time. Review its output before passing results into the next stage. Keep the dataset version, prompt, code, settings, and corrections together.

1. Data cleaning: audit missing values and duplicates

Use for customer records, surveys, and exported spreadsheets.

Copy-ready prompt

Audit [dataset] using [identifier] and the supplied data dictionary. Report row count, duplicate identifiers, missing values by column, invalid types, inconsistent categories, and unusual ranges. Return flagged record IDs and a proposed correction log with reasons. Do not change or delete records without approval. Provide reproducible code; state if you cannot execute it.

Check: Reconcile flagged records with the original. Repeated identifiers can be legitimate; missing values are not automatically errors.

Sample audit table highlights a missing amount and two records sharing order ID 102.
Flag missing values and repeated identifiers before deciding how to clean them.

2. Data transformation: scale numeric variables

Use when a method is sensitive to differences in measurement scale.

Copy-ready prompt

For [columns] in [dataset], assess whether min-max scaling or z-score standardization suits [method]. Explain the choice, preserve original columns, and report transformation parameters. For predictive modeling, learn preprocessing only within each training split or fold, then apply those fitted transformations to validation/test data. Supply reproducible code and before-and-after summaries.

Check: Scaling does not improve every model. Test values can fall outside the training min-max range.

Original values 10, 20 and 30 become 0, 0.5 and 1 after min–max scaling.
Fit scaling on training data and reuse the same transformation on held-out data.

3. Descriptive statistics: summarize the dataset

Use for an initial overview before modeling.

Copy-ready prompt

Summarise [dataset]. For numeric fields, report valid and missing counts, mean, median, standard deviation, minimum, maximum, and quartiles. Specify sample or population standard deviation. For categories, report counts, percentages, and denominators. Flag skewed distributions without labeling them errors. Include reproducible calculations and explain exclusions.

Check: Recalculate important values independently. Outliers can affect the mean more than the median.

Dot plot of five values shows a mean of 40, median of 30 and sample standard deviation of 35.36.
Report both center and spread, especially when the distribution contains extreme values.

4. Data visualization: choose meaningful charts

Use for presentations, dashboards, and research reports.

Copy-ready prompt

Visualize [question] using [dataset] and [columns]. Recommend a chart and justify it. Include descriptive titles, axes, units, legends, and sensible scales. Document missing-data treatment and aggregation. Create the chart if supported; otherwise, return reproducible plotting code. For bar charts, start the value axis at zero. Supply the plotted values for checking.

Check: Compare chart values with the underlying table. Use bars for categories, histograms for distributions, and scatter plots for relationships.

Three chart types illustrate category counts, a numeric distribution and paired numeric observations.
Use bars for categories, histograms for distributions and scatter plots for relationships.

5. Trend analysis: examine changes over time

Use for observed changes, not automatic causal explanations.

Copy-ready prompt

Analyze [metric] by [date] over [period]. Aggregate by [week/month/quarter], identify missing periods, and explain whether values should be summed or averaged. Calculate changes with explicit denominators and plot the series. Discuss possible trend and seasonal patterns cautiously. Separate observations from hypotheses; do not infer causes from the graph alone.

Check: Check date frequency, time zone, and coverage. A missing period is not necessarily a zero.

Monthly revenue chart leaves a visible gap in June because that observation is missing.
Keep missing periods visible when examining a time trend.

6. Regression: model relationships

Use when a justified statistical model can address the question.

Copy-ready prompt

Assess regression for [target] using [predictors] in [dataset]. Explain assumptions and limitations. Choose validation suited to time order or grouped observations where relevant. Prevent leakage, fit using reproducible code, report coefficients and appropriate evaluation metrics, inspect residuals, and compare with a simple baseline. Distinguish prediction, association, and causal inference.

Check: Review assumptions and held-out performance. Coefficients alone do not establish cause and effect.

Training fit and held-out residuals illustrate regression validation on twelve fictional observations.
Evaluate a regression on held-out data and inspect its residuals.

7. Categorical analysis: compare proportions

Use for survey responses, product categories, or sales channels.

Copy-ready prompt

Group [dataset] by [category]. Report counts, percentages, and explicit denominators, keeping a missing/unknown group where appropriate. State whether shares describe customers, transactions, units or revenue. Create a sorted bar chart and reconcile categories to the source total. Flag overlapping or multi-select categories before expecting percentages to sum to 100%.

Check: Count shares and revenue shares to answer different questions. Rounding can also affect percentage totals.

Electronics represents 66.7 percent of transactions and 74.5 percent of revenue in a three-order example.
State the denominator when comparing categorical proportions.

8. Clustering: explore similar observations

Use for exploratory segmentation, not proof of natural categories.

Copy-ready prompt

Explore clustering [dataset] using [features]. Review feature types, missingness, scaling, and outliers. Assess whether K-means is suitable. Compare justified cluster counts with appropriate diagnostics, including silhouette scores where meaningful. Report group sizes and profiles, supply reproducible code, and test sensitivity to features, scaling, and random seeds. Keep segment labels provisional.

Check: A high diagnostic score does not establish business usefulness. Evaluate stability and the purpose of each segment.

Scatter plot displays three provisional groups found by k-means in synthetic two-feature data.
Treat clusters as provisional groups and test their stability and usefulness.

9. Correlation: assess variable associations

Use to explore the direction and strength of relationships.

Copy-ready prompt

Examine [A] and [B] in [dataset]. Inspect measurement types, relationship shape, outliers, and missingness. Justify Pearson or Spearman correlation and explain assumptions for any inference. Report the coefficient, the analyzed sample size, and a labeled plot. Discuss uncertainty and possible confounding. Do not interpret association as causation.

Check: Pearson measures linear association; Spearman assesses rank-based monotonic association. Inspect the plot as well as the coefficient.

Scatter plot of thirty synthetic pairs illustrates a positive Pearson correlation.
Inspect the scatter plot and sample size alongside the correlation coefficient.

10. Sentiment analysis: organize feedback

Use for reviews, survey comments, and support records.

Copy-ready prompt

Classify approved, de-identified feedback from [dataset] as positive, negative, neutral, or mixed. Define decision rules, preserve record IDs, identify recurring themes and flag ambiguous cases. Report category counts and examples using only supplied text. Do not invent quotations. Propose a representative manual validation sample and document disagreements.

Check: Review sarcasm, mixed opinions, and specialist language. Sentiment labels are interpretations, not direct measurements of emotion.

Four fictional feedback comments are labeled positive, negative, neutral and mixed for review.
Retain source comments so reviewers can check sentiment labels.

11. Time-series forecasting: estimate future values

Use only when historical coverage and the task support forecasting.

Copy-ready prompt

Forecast [metric] for [horizon] using [dated dataset]. Check frequency, missing periods, and historical coverage. If evidence is insufficient, explain why. Compare an appropriate model with naive or seasonal-naive forecasts. Use chronological or rolling validation and a justified error metric. Supply forecast intervals where supported, reproducible code, assumptions, and limitations.

Check: Keep future observations out of training. Forecasts are conditional estimates, not guaranteed outcomes.

Observed monthly revenue is followed by a dashed naive forecast of 160 pounds for each of the next three months.
Compare forecasting models with a simple baseline and keep future values distinct.

12. Automated reporting: explain validated findings

Use after calculations and evidence tables have been checked.

Copy-ready prompt

Using only the validated outputs for [project], prepare an executive summary, methods, key statistics, suggested figures, limitations, and recommendations. Reference the source table or calculation for each finding. Separate observed facts, possible explanations, and recommendations. Flag missing evidence and unsupported claims instead of inventing results.

Check: Trace every metric to its calculation. Recommendations must reflect the scope and strength of the evidence.

Verified sample totals support a limited statement that electronics leads revenue within three fictional orders.
Tie each report statement to a checked calculation and state the sample limitation.

For implementation details, consult pandas guidance on missing data, scikit-learn’s preprocessing guide, and its data-leakage guidance. SciPy documents the distinct uses of Pearson and Spearman correlation.

Worked example: inspect, calculate, and report sales

The following three transactions are fictional. Revenue equals quantity multiplied by unit price; no discounts, returns, or taxes are included.

Date (2026) Category Region Quantity Unit price Revenue
1 January Electronics North 2 £100 £200
2 January Clothing South 3 £40 £120
3 January Electronics North 1 £150 £150

Apply template 1 to inspect the records, template 3 to summarize them, template 7 to compare revenue shares, and template 12 to report checked findings. The results are six units and £470 revenue: £350 from electronics and £120 from clothing. Electronics represents approximately 74.5% of sample revenue.

Fictional revenue chart showing electronics at £350 and clothing at £120, with £470 total revenue across three transactions
Fictional example: electronics contributes £350 and clothing £120, reconciling to £470 total revenue.

Report that electronics generated the most revenue in this sample. Three transactions cannot establish a sustained trend or support a reliable forecast. AOFIRS’s Researcher’s Journey from raw data to actionable insight discusses the progression from descriptive findings to more demanding analytical questions.

How to check AI data analysis

  • Reconcile source and output row counts, exclusions, and totals.
  • Independently recalculate important figures and inspect the code or formulas.
  • Check assumptions, denominators, units, and missing-value treatment.
  • Inspect chart scales, labels, and underlying plotted values.
  • Check model validation, baselines, leakage, and uncertainty.
  • Separate observations from hypotheses and document human corrections.

For forecasting validation, scikit-learn explains why time-ordered splits avoid evaluating past observations using future training data. Its silhouette-analysis example illustrates one clustering diagnostic, rather than a universal proof of valid segments.

For research applications, AOFIRS’s report on AI tools in market research emphasizes critical review. The learning publication on integrating generative AI into a research workflow offers related context for keeping source evidence and generated interpretation distinct.

Choose tools by capability, not just their names

Environment Useful capability What to check
AI chat with file and execution tools Data inspection, code, and charts were enabled Actual file access, executed code, and exportable results
Copilot in Excel Workbook questions, formulae, and chart assistance Available modes, subscription, and workbook changes
Gemini in Google Sheets Formulas, analysis, and charts Eligible plan, analysis steps, and chart source data
Python or R Scripted, repeatable statistical workflows Code, dependencies, assumptions, and validation

Capabilities vary by account and environment. Test a small known dataset before relying on a workflow. Save prompts, code, data versions and outputs so another analyst can inspect the work.

Frequently asked questions

What makes a data analysis prompt effective?

Specify the dataset, question, relevant fields, method, output, and checks. Make uncertainty and missing information visible.

Can AI clean data automatically?

Some tools can execute changes. Request an audit and proposed corrections first, then review and approve them.

Can AI perform regression and forecasting?

An execution-enabled tool can fit models, or a text assistant can generate code. Appropriate design and validation remain essential.

Do I need Python or SQL?

Not always. Spreadsheet tools support many tasks. Code is valuable for complex processing, repeatable workflows, and independent checking.

Are generated charts always accurate?

No. Check the plotted values, aggregation, missing records, labels, and scales against the underlying data.

Can I upload confidential research records?

Use only approved arrangements that meet applicable obligations and policies. Minimize sensitive information and review access and retention controls.

Conclusion

A useful prompt defines a task that can be checked. Preserve the data, choose a suitable method, inspect executed calculations, and report limitations. Reliable conclusions come from the whole analytical process, not from prompt wording alone.

Share This Story