PromptHub
Back to Blog
Technology Data Science

50 Best Prompts for Data Analysis in ChatGPT: A Complete Guide to Unlocking Insights with AI

B

Bright Coding

Author

14 min read 120 views
50 Best Prompts for Data Analysis in ChatGPT: A Complete Guide to Unlocking Insights with AI

Discover the 50 most powerful ChatGPT prompts for data analysis that will transform raw numbers into actionable business intelligence. From Excel automation to Python↗ Bright Coding Blog scripting, this comprehensive guide includes step-by-step workflows, real-world case studies, and the essential tools every data analyst needs in 2026.


Data is the new oil but only if you know how to refine it. In 2026, ChatGPT has evolved from a conversational AI into a powerful analytical co-pilot capable of cleaning datasets, writing Python scripts, generating SQL queries, and building predictive models. Whether you're a business analyst, marketer, financial trader, or data scientist, the right prompt can mean the difference between hours of manual work and instant insight.

This guide delivers 50 battle-tested prompts organized by real-world use cases, complete with step-by-step workflows, recommended tools, and case studies that demonstrate measurable ROI.


Essential Tools for AI-Powered Data Analysis

Before diving into prompts, equip your workflow with these tools:

Tool Purpose Integration with ChatGPT
ChatGPT Code Interpreter / Advanced Data Analysis Upload CSVs, run Python, generate charts Native OpenAI feature
Microsoft Excel / Google Sheets Spreadsheet manipulation Export/import ChatGPT-generated formulas
Python (Pandas, Matplotlib, Seaborn) Advanced statistical analysis ChatGPT writes and debugs code
SQL (MySQL↗ Bright Coding Blog, PostgreSQL↗ Bright Coding Blog, BigQuery) Database querying ChatGPT generates and optimizes queries
Tableau / Power BI Business intelligence dashboards ChatGPT creates DAX calculations and data prep scripts
Jupyter Notebook Reproducible data science ChatGPT generates full notebook cells
Notion / Obsidian Documentation and knowledge management Store prompt templates and outputs
Zapier / Make Workflow automation Trigger ChatGPT analysis on new data uploads

The Prompt Framework: How to Structure High-Performance Data Prompts

Every powerful data prompt follows the COSTAR framework:

  • Context: What data are you working with?
  • Objective: What do you want to achieve?
  • Style: What format should the output take?
  • Tone: Professional, technical, or beginner-friendly?
  • Audience: Who will consume this analysis?
  • Response: Specify length, format (table, code, narrative).

50 Best Prompts for Data Analysis in ChatGPT

Category 1: Data Cleaning & Preparation (Prompts 1–8)

1. Automated Data Cleaning

"I have a dataset with missing values, duplicates, and inconsistent formatting. Write a Python script using Pandas to: (1) identify missing values per column, (2) remove duplicate rows, (3) standardize date formats to YYYY-MM-DD, (4) trim whitespace from text fields, and (5) detect outliers using the IQR method. Include comments explaining each step."

2. Schema Detection

"Analyze this CSV structure [paste headers/sample rows] and recommend optimal data types for a SQL database schema. Identify primary keys, foreign key relationships, and indexes that would improve query performance."

3. Text Normalization

"I have a column containing customer names with inconsistent capitalization, special characters, and mixed formats (e.g., 'J. Smith', 'smith, john', 'JOHN SMITH'). Create a Python function that normalizes all entries to 'Title Case' and removes extra whitespace."

4. Missing Value Strategy

"My dataset has 15% missing values in the 'revenue' column and 3% missing in the 'customer_segment' column. Recommend and justify the best imputation strategy for each column. Provide Python code to implement your recommendations."

5. Data Validation Rules

"Generate a set of data validation rules for an e-commerce dataset containing order_id, customer_email, order_date, product_price, and quantity. Include regex patterns, range checks, and referential integrity constraints."

6. Column Renaming & Reorganization

"I have a messy dataset with columns named 'Col1', 'temp_field', 'unnamed: 3', and 'Final_Cost_USD'. Suggest semantic, snake_case names for all columns and provide a Python script to rename them systematically."

7. Currency & Unit Standardization

"My sales dataset contains prices in USD, EUR, and GBP across different rows. Write a Python script that detects the currency column, converts all amounts to USD using a provided exchange rate dictionary, and adds a 'price_usd' column."

8. Bulk File Processing

"I have 50 CSV files in a folder, all with the same structure but different filenames. Write a Python script that reads all files, concatenates them into a single DataFrame, adds a 'source_file' column tracking the origin, and exports the combined dataset."


Category 2: Exploratory Data Analysis (EDA) (Prompts 9–16)

9. Automated EDA Report

"Perform an exploratory data analysis on the uploaded dataset. Generate summary statistics, identify distributions for all numeric columns, detect correlations above 0.7, highlight categorical imbalances, and produce a concise narrative report of key findings."

10. Correlation Matrix Visualization

"Create a Python script that generates a correlation heatmap for all numeric columns in my dataset. Use Seaborn, annotate correlation values, and save the figure as a high-resolution PNG. Ensure the color scheme is colorblind-friendly."

11. Distribution Analysis

"Analyze the distribution of the 'customer_age' and 'purchase_amount' columns. Determine if they follow a normal distribution using the Shapiro-Wilk test, identify skewness and kurtosis values, and recommend appropriate transformations if needed."

12. Categorical Breakdown

"For every categorical column in my dataset, generate a frequency table showing counts and percentages. Identify rare categories (less than 1% of total) and recommend whether to group them into an 'Other' category."

13. Time-Series Pattern Detection

"I have a daily sales dataset spanning two years. Identify trends, seasonality patterns, and anomalies. Decompose the time series into trend, seasonal, and residual components using statsmodels, and visualize each component."

14. Pareto Analysis (80/20 Rule)

"Apply Pareto analysis to my product sales data. Identify which products generate 80% of revenue, create a cumulative percentage chart, and provide strategic recommendations for inventory management based on the findings."

15. Geographic Distribution

"My dataset contains customer coordinates (latitude/longitude) or country codes. Generate a choropleth map or scatter plot showing customer density by region, and identify underperforming geographic markets."

16. Automated Insight Generation

"Scan my dataset for non-obvious patterns, anomalies, and relationships. Generate 5 data-driven hypotheses that could explain surprising correlations, and suggest how to test each hypothesis statistically."


Category 3: SQL & Database Analysis (Prompts 17–23)

17. Complex Query Builder

"I have tables: customers (customer_id, name, signup_date), orders (order_id, customer_id, order_date, total), and order_items (item_id, order_id, product_id, quantity, price). Write a SQL query that finds the top 10 customers by lifetime value in the last 12 months, including their average order value and purchase frequency."

18. Query Optimization

"This SQL query is running slowly on a table with 10 million rows: [paste query]. Analyze it, identify performance bottlenecks, and rewrite it with optimizations including proper indexing recommendations."

19. Window Functions Tutorial

"Explain SQL window functions (ROW_NUMBER, RANK, DENSE_RANK, LEAD, LAG) using my sales dataset. Write 5 practical queries that demonstrate each function for analyzing month-over-month growth and customer ranking."

20. Pivot & Unpivot Operations

"Write a SQL query that transforms my sales data from long format (date, product, revenue) to a wide pivot format with products as columns and months as rows. Also provide the reverse unpivot query."

21. Cohort Retention Analysis

"Using a user_events table with user_id, event_date, and event_type columns, write a SQL query that calculates monthly cohort retention rates for users who signed up in the last 12 months."

22. Data Quality Audit Query

"Write a comprehensive SQL script that audits data quality across all tables in my database. Check for: orphaned foreign keys, NULL values in required fields, duplicate primary keys, and date range anomalies."

23. Recursive CTE for Hierarchies

"My employee table has employee_id, name, and manager_id columns. Write a recursive SQL query that generates the complete organizational hierarchy, showing each employee's level and management chain."


Category 4: Statistical Analysis & Hypothesis Testing (Prompts 24–30)

24. A/B Test Analysis

"I have A/B test results with columns: variant (A/B), conversions (0/1), and revenue. Perform a chi-square test for conversion rate difference, a t-test for revenue difference, calculate confidence intervals, effect size (Cohen's d), and statistical power. Provide a business recommendation."

25. Regression Analysis

"Build a multiple linear regression model predicting 'sales' from 'ad_spend', 'price', and 'seasonality_index'. Include assumption checks (linearity, normality, homoscedasticity), output coefficients with p-values, and interpret R-squared and adjusted R-squared."

26. Segmentation with Clustering

"Apply K-means clustering to my customer dataset using 'recency', 'frequency', and 'monetary' features. Determine the optimal number of clusters using the elbow method and silhouette score. Profile each cluster and suggest marketing strategies."

27. Anomaly Detection

"Implement an anomaly detection algorithm on my transaction dataset. Use the Isolation Forest method to flag suspicious transactions, explain the isolation score, and provide a summary of anomalies by category and time period."

28. Survival Analysis

"My dataset tracks customer subscription start dates and churn dates (or NULL if active). Perform survival analysis using the Kaplan-Meier estimator, plot survival curves by subscription tier, and calculate median survival time."

29. Sentiment Analysis at Scale

"I have 1,000 customer reviews in a CSV. Write a Python script that uses a pre-trained sentiment model (VADER or TextBlob) to classify each review as positive, neutral, or negative. Generate a summary table showing sentiment distribution by product category."

30. Forecasting with Confidence Intervals

"Using my 3-year monthly sales data, build a forecasting model using Prophet or ARIMA. Generate a 12-month forecast with 80% and 95% confidence intervals, identify seasonality components, and visualize actual vs. predicted values."


Category 5: Data Visualization & Reporting (Prompts 31–37)

31. Executive Dashboard Summary

"Analyze this quarterly business dataset and generate an executive summary with 5 key metrics, 3 critical trends, and 2 red flags. Format as a CEO-ready narrative with bullet points and recommended actions."

32. Automated Chart Generation

"Write Python code that generates a 4-panel dashboard from my dataset: (1) line chart for trends, (2) bar chart for comparisons, (3) pie chart for proportions, (4) scatter plot for correlations. Use Matplotlib with a professional color palette and save as PDF."

33. Interactive Plotly Charts

"Convert my static sales report into interactive Plotly visualizations. Create a dropdown-filterable line chart by region, a hoverable heatmap for product performance, and a zoomable time-series chart."

34. Report Automation Template

"Create a Python script that generates a weekly automated report from my database. It should query fresh data, calculate KPIs, generate visualizations, and compile everything into an HTML email template with inline CSS styling."

35. Data Storytelling Narrative

"Transform these raw statistics [paste data] into a compelling data story. Structure it with a hook, conflict (the business problem), rising action (analysis findings), climax (the key insight), and resolution (actionable recommendations)."

36. Accessibility-First Visualization

"Redesign my current chart descriptions for screen reader accessibility. Provide alt-text recommendations, high-contrast color schemes, and pattern-based alternatives to color coding for categorical data."

37. One-Page Summary (Infographic Style)

"Summarize my annual report data into a structured text format suitable for an infographic. Organize into: headline stat, 3 supporting metrics with context, 1 quote-worthy insight, and a call-to-action."


Category 6: Excel & Spreadsheet Automation (Prompts 38–43)

38. Advanced Formula Generation

"I need an Excel formula that looks up a product ID in Sheet1, matches it against a price table in Sheet2, applies a tiered discount based on quantity (1-10: 0%, 11-50: 5%, 51+: 10%), and returns the final price including 8% tax."

39. Pivot Table Configuration

"Guide me step-by-step to create a pivot table in Excel that shows total revenue by product category and region, with a slicer for quarter selection. Include the exact field placements and value settings."

40. VBA Macro for Repetitive Tasks

"Write a VBA macro that loops through all worksheets in my workbook, formats headers in bold with a blue background, auto-fits column widths, applies currency formatting to column D, and saves each sheet as a separate PDF."

41. Google Sheets API Integration

"Write a Google Apps Script that triggers daily at 9 AM, fetches data from an external API, appends it to a specific sheet, and sends an email summary if any metric exceeds a defined threshold."

42. Conditional Formatting Rules

"Create a set of Excel conditional formatting rules for a sales dashboard: (1) red highlight if revenue < target by >10%, (2) green arrow if growth >5% MoM, (3) yellow flag if inventory < safety stock. Provide the exact formulas."

43. Power Query Transformation

"Write the M-code for a Power Query transformation that: imports a folder of CSVs, promotes headers, unpivots monthly columns into rows, adds a calculated 'growth_rate' column, and loads to a data model."


Category 7: Business Intelligence & Strategic Analysis (Prompts 44–50)

44. Competitive Benchmarking

"I have my company's metrics and 3 competitors' public data for revenue growth, market share, customer satisfaction, and R&D spend. Perform a competitive gap analysis, calculate relative market position, and suggest strategic priorities."

45. Customer Lifetime Value (CLV)

"Calculate Customer Lifetime Value for my subscription business using historical data. Apply cohort-based and predictive methods, segment CLV by acquisition channel, and identify the highest-value customer personas."

46. Pricing Optimization

"Analyze my historical sales data across different price points and demand elasticity. Recommend an optimal pricing strategy using a demand curve model, and simulate revenue impact of a 10% price increase vs. a 5% volume discount."

47. Churn Prediction Model

"Build a churn prediction model using my customer dataset. Identify the top 5 churn indicators, calculate feature importance, create risk segments (high/medium/low), and propose retention interventions for each segment."

48. Market Basket Analysis

"Perform market basket analysis on my transaction data using the Apriori algorithm. Identify product association rules with support >0.05 and confidence >0.3, and recommend bundle pricing strategies."

49. ROI Calculation Framework

"I have campaign data with spend, impressions, clicks, conversions, and revenue. Build a comprehensive ROI calculator in Python that computes ROAS, CPA, LTV:CAC ratio, payback period, and breakeven analysis."

50. Automated Insight Alert System

"Design a Python-based monitoring system that: connects to my database daily, runs predefined analytical checks, detects significant deviations (>2 standard deviations) from baseline, and generates a natural language alert message suitable for Slack or email."


Step-by-Step Guide: From Raw Data to Insight

Workflow 1: The 15-Minute Data Cleaning Pipeline

Step 1: Upload your CSV to ChatGPT Advanced Data Analysis. Step 2: Use Prompt #1 (Automated Data Cleaning) to generate a Python script. Step 3: Run the script and review the cleaning report. Step 4: Use Prompt #5 (Data Validation Rules) to verify cleanliness. Step 5: Export the cleaned dataset for analysis.

Result: A publication-ready dataset in under 15 minutes.

Workflow 2: The Executive Report Generator

Step 1: Connect ChatGPT to your SQL database or upload a CSV. Step 2: Use Prompt #17 (Complex Query Builder) to extract key metrics. Step 3: Use Prompt #31 (Executive Dashboard Summary) for narrative insights. Step 4: Use Prompt #32 (Automated Chart Generation) for visualizations. Step 5: Compile into a single PDF or presentation deck.

Result: Board-ready analytics in 30 minutes.

Workflow 3: The Predictive Analytics Pipeline

Step 1: Upload historical time-series data. Step 2: Use Prompt #13 (Time-Series Pattern Detection) to understand seasonality. Step 3: Use Prompt #30 (Forecasting) to generate future projections. Step 4: Use Prompt #47 (Churn Prediction) to identify at-risk revenue. Step 5: Present findings with confidence intervals to stakeholders.

Result: Data-driven strategic planning with quantified uncertainty.


Real-World Use Cases

Use Case 1: E-commerce Revenue Optimization

A mid-sized Shopify store used Prompts #1, #5, #30, and #46 to clean 2 years of transaction data, identify seasonal demand patterns, and optimize pricing. Result: 23% revenue increase in Q2 through dynamic pricing and inventory alignment.

Use Case 2: SaaS Churn Reduction

A B2B SaaS company applied Prompts #22, #29, and #47 to analyze support tickets, NPS scores, and usage telemetry. Result: Identified "onboarding completion rate" as the #1 churn predictor; reduced churn by 18% with targeted interventions.

Use Case 3: Marketing Attribution

A digital agency used Prompts #17, #49, and #44 to unify Google Ads, Facebook, and organic data. Result: Discovered 34% of attributed conversions were double-counted; reallocated $50K monthly budget to underinvested channels, improving ROAS by 41%.

Use Case 4: Financial Fraud Detection

A fintech startup implemented Prompts #8, #27, and #50 to process 100K daily transactions. Result: Reduced false positives by 60% while catching 12% more genuine fraud cases, saving an estimated $2.4M annually.

Use Case 5: Healthcare Resource Planning

A hospital network used Prompts #13, #30, and #32 to forecast emergency department admissions. Result: Improved staffing accuracy by 31%, reducing patient wait times and overtime costs simultaneously.


Case Study: How DataPrompts.io Scaled Analytics 10x

Company: A 50-person marketing analytics agency Challenge: Manual reporting consumed 60% of analyst time; client deliverables were delayed. Solution: Implemented a ChatGPT prompt library based on the 50 prompts above, integrated with Python automation and SQL databases.

Implementation:

  • Week 1: Standardized data cleaning using Prompts #1–8 (saved 12 hrs/week)
  • Week 2: Automated client reports using Prompts #31–34 (saved 20 hrs/week)
  • Week 3: Deployed predictive models using Prompts #26, #30, #47 (new revenue stream)

Results (6 months):

  • Analyst productivity increased 340%
  • Client reporting turnaround reduced from 5 days to 4 hours
  • Won 3 new enterprise contracts due to "AI-powered analytics" positioning
  • ROI: 1,200% on ChatGPT Plus and development time investment

Resource Link

For additional prompt templates, ready-to-use Python scripts, and a community of data analysts leveraging AI, visit: Data Analysis & Scripts Hub — BrightCoding Resources


Conclusion

The difference between drowning in data and surfing it lies in the questions you ask. These 50 prompts are not just text strings they are analytical accelerators that transform ChatGPT from a chatbot into a senior data analyst, available 24/7.

Start with the workflow that matches your immediate need. Master the COSTAR framework. Combine these prompts with Python, SQL, and visualization tools. Most importantly, treat AI as your collaborative partner, not a replacement for critical thinking.

The future belongs to analysts who can orchestrate AI at scale. These 50 prompts are your orchestra conductor's baton.


Ready to analyze? Copy your first prompt, upload your dataset, and watch the insights unfold.

Comments (0)

Comments are moderated before appearing.

No comments yet. Be the first to share your thoughts!

Recommended Prompts

View All