How to Do Data Analysis with ChatGPT
Using ChatGPT for data analysis can feel like getting a sneak peek into the future, and it's more accessible than you might think. With the right approach, you can turn a spreadsheet of raw numbers into clear insights just by asking questions in plain English. This article explains how to prepare your data, write effective prompts to get the analysis you need, and critically evaluate the results it provides.
Start with Clean, Well-Structured Data
Garbage in, garbage out. This classic data-analysis saying is especially true for ChatGPT. It doesn’t have the context you do, so feeding it a messy, disorganized file will lead to messy, disorganized results. Before you upload anything, take a few minutes to prepare your data.
For best results, your data should be in a CSV (Comma Separated Values) file format. This is a universal format that almost any spreadsheet program, including Excel and Google Sheets, can export to.
Three Golden Rules for Data Prep
While you don't need to be a data-cleaning expert, following a few simple best practices will dramatically improve the quality of ChatGPT’s analysis.
- Keep it simple and consistent. Use clean, easy-to-understand column headers with no special characters (e.g., use "Date" instead of "Date of Sale!"). Make sure your data formats are consistent - all dates should be in the same format (MM/DD/YYYY), currencies should be uniform, and categories should be spelled the same way every time (e.g., "United States" not "USA" in some rows and "U.S." in others).
- Remove what isn’t necessary. Delete any blank rows, as they can confuse the analysis. If you have columns that are irrelevant to your questions, consider removing them to simplify the data. This helps ChatGPT focus on the information that matters most.
- Think before you upload. This is the most important rule. Never upload sensitive personal, financial, or proprietary business data to ChatGPT. Your data can be used to train the model, and you should treat anything you upload as public. Stick to anonymized or non-sensitive information for your analysis experiments.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Crafting Effective Prompts: How to Talk to Your Data
The magic happens in the prompt. This is where you move from being a data organizer to a data analyst. Vague questions will get you vague answers. The more specific and contextual your prompts, the better and more accurate your results will be.
To get started, you'll need a ChatGPT Plus subscription, which gives you access to the "Advanced Data Analysis" model (formerly known as Code Interpreter). Simply select this model, click the paperclip icon to upload your CSV file, and wait for it to confirm the upload.
Anatomy of a Powerful Data Prompt
A good prompt gives ChatGPT the information it needs to understand your request and perform the correct actions. Aim to include these analytical elements:
- Announce Your Goal: Start by stating what you want to achieve.
- Identify the Data Source: Mention the filename you uploaded.
- Explain Your Data: Briefly describe what the columns represent if the headers aren't self-explanatory.
- Make a Specific Request: Clearly state the exact calculation, visualization, or analysis you want.
Example Prompt: Bad vs. Good
Imagine you uploaded a file named monthly_ad_spend.csv with columns for Month, CampaignName, Spend, and Conversions.
A generic (bad) prompt:
analyze my data
This is too broad. ChatGPT will likely just give you a generic summary of the file, like the number of rows and columns, and maybe some basic statistics that aren't very useful.
A specific (good) prompt:
Using the file monthly_ad_spend.csv, calculate the total spend and total conversions for each campaign name. Then, create a bar chart that visualizes the total spend for each campaign.
This prompt works because it's packed with clear instructions. It states the goal, identifies the file, and specifically asks for both a calculation (total spend and conversions per campaign) and a visualization (a bar chart of spend).
Think Iteratively with Follow-Up Questions
Your first prompt is often just the beginning. The real power of conversational data analysis is the ability to drill down and explore your data interactively. Once ChatGPT provides an initial response, ask follow-up questions to dig deeper.
Continuing the example above, after it generates the bar chart, you could ask:
- "This is great. Now calculate the cost per conversion for each campaign and display it in a table."
- "Which campaign had the most conversions in May?"
- "Can you recreate the bar chart but stack 'Spend' and 'Conversions' for each campaign to compare them?"
This conversational back-and-forth lets you explore hunches and uncover insights you might not have found with a traditional, more rigid reporting tool.
Interpreting the Output and Spotting Errors
ChatGPT can deliver insights in several ways: plain text summaries, formatted tables, and visualizations like bar charts, line graphs, pie charts, and heatmaps. It can even generate downloadable files, like a new CSV with the calculations it just performed.
Always Question the Results
While the charts might look polished, it's vital to remember that ChatGPT can and does make mistakes. Unlike a calculator or a dedicated BI tool, it sometimes "hallucinates" or misunderstands a request, leading to plausible but incorrect outputs. Its primary function is language generation, not mathematical certainty.
Here’s how to stay grounded:
- Spot-check the math. If ChatGPT gives you a table of summary statistics (like averages, totals, or percentages), pull out a calculator and double-check a few of them yourself. If the basic math is right, you can have more confidence in the more complex analyses.
- Check axis labels and titles. Ensure the charts it produces are labeled correctly. Does the X-axis show what you expected? Is the title of the chart an accurate description of the data being visualized? Sometimes it will mislabel an axis or mix up metrics.
- Make sure it understood your context. If you ask for "profit," but only provided data for "revenue," ChatGPT might just return revenue data with the title "Profit" without asking for cost information. It lacks true business context, so it assumes the data you provide is complete.
Seeing an error is not a dead-end. You can correct it conversationally. For example, if a chart is incorrect, you could say: "You put the dates on the Y-axis. Please regenerate the chart with dates on the X-axis and spend on the Y-axis."
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Knowing the Limitations: Where ChatGPT Falls Short
ChatGPT is a powerful assistant for quick, exploratory analysis, but it's not a replacement for professional business intelligence tools. Understanding its limitations is crucial for using it responsibly.
- It works with static snapshots of data. The biggest limitation is its inability to connect to live data sources. The analysis is only as current as the CSV file you last uploaded. If your Shopify sales data or Google Analytics traffic changes, you have to export a new CSV and restart the entire analysis process. This makes it impractical for ongoing performance monitoring.
- It has processing limits. ChatGPT can't handle massive datasets. If you try to upload a CSV file with hundreds of thousands or millions of rows, it will fail. It's best suited for smaller datasets where you're trying to quickly explore a specific slice of information.
- It’s a black box. You can ask it to build a chart, but sometimes it gets confused and its code doesn't work. Since you've uploaded your data in a closed system, you're stuck troubleshooting it.
- Data privacy remains the primary concern. You should never upload sensitive information of any kind as it's not secured.
These limitations mean that while ChatGPT is an excellent tool for one-off analyses, it isn’t built for creating reliable, automated dashboards that teams rely on to track real-time performance.
Final Thoughts
ChatGPT opens up a new frontier for data analysis, allowing anyone to ask questions of their data without needing to write complex formulas or code. It excels at quick, one-off analyses of non-sensitive CSVs when you need a fast burst of insight. But it's essential to approach it with a critical eye, double-checking its work and appreciating its limitations.
For marketing teams, agencies, and founders who need reliable, real-time analytics, the manual process of exporting and uploading CSVs just doesn't work. We actually built Graphed to solve this very problem. Instead of working with static files, we securely connect directly to your live data sources like Google Analytics, Shopify, Facebook ads, and Salesforce. You can ask questions in plain English, just like with ChatGPT, but instead, you get instant, real-time dashboards that update automatically. You get the simplicity of conversational queries without the headache of stale reports, potential inaccuracies, or data privacy concerns.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.