← Back to Claude Mastery
Claude Mastery · Chapter 14 of 30
14

Working with Data & Analysis

Analyze, Transform, and Extract Insights

⏱️ 12 min read 📊 Intermediate 🎯 Data & Insight

Data is everywhere. Most teams have more of it than they know what to do with. Sales spreadsheets that grow every month. Customer feedback sitting in a CSV. Survey results that nobody has had time to analyse. Financial reports that tell a story — if only someone could read it. The bottleneck is not data. It is analysis.

Quick Answer

Claude compresses the time from raw data to meaningful insight through six capabilities: exploratory data analysis (understanding structure and quality), statistical analysis (descriptive stats, correlations, time series), Excel and Sheets automation (formulas and Apps Scripts), data visualization (chart code generation), and turning numbers into plain-language narratives. Always start with a data overview before any specific analysis, and always end with the business question — what decision does this data inform?

This chapter covers what Claude can and cannot do with data, how to use the Analysis Tool for deeper work, and structured workflows for every major data task — from exploratory analysis through to stakeholder-ready narratives.

What Can Claude Do with Data — and What Are the Limits?

✅ Claude Does This Well
  • Exploratory analysis — Structure, patterns, outliers, data quality
  • Descriptive statistics — Mean, median, SD, quartiles, distribution
  • Correlation analysis — Relationships between variables
  • Time series — Trend, seasonality, anomaly detection
  • Cohort analysis — Retention and segmentation
  • Cleaning and transformation — Standardise, reshape, derive columns
  • Visualisation code — Python, JavaScript, multiple libraries
  • Data narratives — Numbers into plain-language stories
❌ Know the Limitations
  • Very large datasets — Works best up to ~50MB; larger needs specialist tools
  • Real-time data — Uploaded data is static; no live database connections
  • Complex ML modelling — Basic stats yes; training custom models, no
  • Guaranteed accuracy — Verify critical calculations; occasional errors on complex multi-step arithmetic

What Is the Analysis Tool and When Should It Be Used?

The Analysis Tool (also called Code Interpreter) is a significant upgrade for data work. When enabled, Claude can execute code, produce real charts and tables from actual files, handle larger datasets, and iterate on results within the same session.

Use Plain Chat When
  • Quick calculations on small datasets you can paste
  • You want a framework or approach, not executed results
  • You're asking conceptual questions about data
  • You need code to run yourself later
Use Analysis Tool When
  • You have an actual data file to upload and analyse
  • You want real rendered charts and visualisations
  • The dataset is too large to paste into conversation
  • You want iterative analysis: explore → find something → go deeper
Part 1
Exploratory Data Analysis

How Should Every Data Analysis with Claude Begin?

Before any specific analysis, always start with a data overview. This surfaces quality issues before they corrupt results, ensures Claude's understanding of the data matches reality, and identifies the most valuable analyses to run.

I've uploaded [filename]. Before specific questions: 1. What data is in this file? (columns, data types, row count) 2. What time period does this cover? 3. Are there obvious data quality issues? (missing values, outliers, inconsistent formats) 4. What would be the most valuable analyses for this data? 5. Any columns that might need cleaning before analysis? Give a clear overview so there is a shared understanding before diving into specific questions.

Addressing Data Quality

After the overview, fix quality issues before analysis:

Based on the overview, address data quality before analysis. For each issue identified: 1. Describe the issue specifically 2. Recommend the best approach to handle it 3. Show code to implement the fix Then apply all fixes and confirm the cleaned dataset is ready for analysis.
Part 2
Statistical Analysis

How Do You Run Statistical Analysis with Claude?

Technique 1
Descriptive Statistics
Analyse [column name / dataset] and provide: CENTRAL TENDENCY: - Mean, median, and mode - What does the difference between mean and median reveal about the distribution? SPREAD: - Standard deviation and variance - Min, max, range - 25th and 75th percentile (IQR) DISTRIBUTION: - Is it normally distributed? How can you tell? - Significant outliers — define and list them. PRACTICAL INTERPRETATION: - What do these statistics mean in plain language for someone who doesn't think in statistics?
Technique 2
Correlation Analysis
Analyse the relationship between [variable A] and [variable B]. 1. Calculate the correlation coefficient 2. Explain what this means in practical terms (not just "0.72 correlation" — what does that actually imply?) 3. Create a scatter plot showing the relationship 4. Identify any outliers that distort the correlation 5. Flag whether correlation implies causation here — and why Context: [What these variables represent and why the relationship matters to the decision being made]
Technique 3
Time Series Analysis
Analyse this time series: [column/variable] TREND: - Overall upward, downward, or flat trend? - Linear or accelerating/decelerating? SEASONALITY: - Repeating patterns? (weekly, monthly, quarterly) - Typical peak period and trough period? ANOMALIES: - Which time periods deviate significantly from trend? - What might explain them? FORECAST: - Based on trend and seasonality, what do the next [3/6/12] months look like if the pattern continues? - What assumptions does this forecast rely on? Create a line chart with the trend line overlaid.
Technique 4
Cohort Analysis
Customer data with [signup date] and [activity/purchase dates]. Build a cohort analysis showing: 1. Monthly cohorts (customers grouped by signup month) 2. Retention rate at 1, 3, 6, and 12 months after signup 3. Which cohorts retained best? What's different about them? 4. Revenue retention if revenue data is available Visualise as a heatmap: - Rows = cohort (signup month) - Columns = months since signup - Cell values = retention rate % - Colour intensity = retention rate (darker = better)
Part 3
Excel & Google Sheets

How Do You Use Claude Effectively with Excel and Google Sheets?

The Excel Analysis Workflow

When working with an Excel file, follow three steps:

Step 1 — Upload and orient: Uploaded [filename.xlsx]. Tell me: - How many sheets and what's in each? - Key columns in the main data sheet? - Any data that's calculated vs raw? - Anything unusual about the structure? Step 2 — Targeted analysis: Using [sheet name] data, please: - Calculate [specific metrics] - Identify [specific patterns] - Compare [period A] vs [period B] Show results as a formatted table. Step 3 — Narrative output: Write a 3-paragraph executive summary: - Paragraph 1: The headline story (most important finding) - Paragraph 2: Supporting detail (2-3 metrics that back it up) - Paragraph 3: Implications and recommended actions Write for a non-technical audience — no jargon.

Writing Complex Excel Formulas

Claude can write formulas that would take an hour to research manually:

Write an Excel formula for: GOAL: [What the formula should calculate] SHEET STRUCTURE: - Column A: [Description] - Column B: [Description] - Column C: [Description] EXAMPLE: If A2 = "Pro", B2 = 150, C2 = "2024-03-15" Expected result: [What should be returned] CONSTRAINTS: - Works in Excel 365 / Google Sheets - Handles blank cells without errors Please also explain how the formula works.

Real example:

Write a formula for column D that calculates a customer's risk score based on: - Column A: Days since last purchase - Column B: Total lifetime spend - Column C: Number of support tickets Risk logic: - HIGH: >90 days since purchase AND lifetime spend > $1,000 - MED: 30-90 days since purchase OR more than 3 support tickets - LOW: everything else Handle blank values in any column as 0.

Google Sheets Automation

Write a Google Apps Script that: TRIGGER: Runs every Monday at 9am WHAT IT DOES: 1. Reads data from Sheet "Raw Data" (columns A-F) 2. Filters rows where column D = "Completed" 3. Calculates sum of column E per unique value in column B 4. Writes results to Sheet "Weekly Summary" at A2 (overwriting previous week) 5. Sends email with subject "Weekly Summary - [date]" and the summary table as plain text COLUMN DESCRIPTIONS: A: Date | B: Team name | C: Task | D: Status | E: Hours | F: Notes Include error handling — if the script fails, send an error email with the message.
Part 4
Data Visualisation

How Do You Generate Data Visualisations with Claude?

Choosing the Right Chart Type

Goal Chart Type
Trends over timeLine chart
Comparing categoriesBar chart (vertical) or column chart (horizontal for many categories)
Part-to-whole relationshipsPie chart (max 5 segments) or stacked bar
Relationship between two variablesScatter plot
Distribution of valuesHistogram or box plot
Matrix patterns (cohorts, correlations)Heatmap

Generating Visualisation Code

Create a [chart type] using [matplotlib / plotly / chart.js]. DATA: [Paste data or describe its structure] REQUIREMENTS: - Title: "[Your title]" - X-axis: [label and description] - Y-axis: [label and description] - Colour scheme: [professional / brand colours / sequential] - Annotations: [label top 3 values / mark threshold line at Y=X] - Size: [dimensions in pixels] STYLE: - Clean, minimal design - Suitable for [presentation / dashboard / report] Provide complete, runnable code with sample data so it can be verified before substituting real data.

Multi-Chart Dashboard

Create a Python dashboard using Plotly Dash showing: CHARTS: 1. Monthly revenue trend (line chart) — top left 2. Revenue by product category (bar chart) — top right 3. Customer acquisition by channel (pie chart) — bottom left 4. Monthly active users (line chart) — bottom right DATA SOURCE: [Describe data structure] INTERACTIONS: - Date range filter applying to all charts - Click category in chart 2 to filter all others STYLE: Clean, professional. Navy and white. Responsive layout. Provide complete, runnable code.
Part 5
Turning Data into Narratives

How Do You Turn Data Findings into a Clear Narrative for Any Audience?

One of Claude's most underused data capabilities is turning numbers into stories. Data only becomes valuable when stakeholders understand it — and most stakeholders do not think in statistics.

Data findings: [Paste key metrics or analysis results] Write a [document type] for [audience]: DOCUMENT TYPE: [Executive summary / Board update / Team report] AUDIENCE: [CFO / All-hands / Investors / Technical team] LENGTH: [3 paragraphs / 1 page / 500 words] Requirements: - Lead with the most important finding - Use specific numbers to support claims - Explain trends in plain language - End with clear implications or actions Avoid: jargon, passive voice, hedging ("it appears that") Use: active voice, specific facts, confident conclusions

Turning a Dashboard into a Briefing

Here is what the analytics dashboard shows: [Describe your metrics — numbers, trends, comparisons] Based on these metrics, write: 1. A one-sentence headline for this period (the single most important thing) 2. A 3-bullet summary for a busy executive (one insight per bullet, with specific numbers) 3. A 2-paragraph narrative for a team update (what happened and what it means going forward) 4. Three specific questions this data raises that should be investigated further
Part 6
Analysis Prompting Patterns

What Are the Most Effective Data Analysis Prompting Patterns?

The Business Question First

Instead of "analyse this data," start with the decision that needs to be made:

Business question: [Why are customers churning in month 3?] Available data: [Describe available datasets] What analysis would best answer this question? What additional data would help? Walk through the recommended approach.

The Anomaly Investigation

A specific anomaly was noticed in the data: [Example: Revenue dropped 23% in March despite no price changes] Help investigate: 1. Confirm the anomaly is real (not a data artefact) 2. Identify possible explanations (list 5-7) 3. Determine which data is needed to test each explanation 4. Suggest the order to investigate (highest probability first)

The Comparison Request

Compare [Period A / Group A / Product A] vs [Period B / Group B / Product B]. For each metric: - Show absolute difference - Show percentage difference - Flag if the difference is statistically meaningful or could be normal variation Key metrics: [List your metrics] Highlight the 3 most significant differences and suggest what might be driving them.

What Are the Most Common Data Analysis Mistakes to Avoid?

Mistake 1: Skipping Exploratory Data Analysis

❌ Jump straight to complex analysis on unexamined data ✅ Always start with the data overview — understand before analysing

Mistake 2: Confusing Correlation and Causation

❌ "More spend correlates with more revenue, so marketing is causing revenue growth" ✅ Ask: "What alternative explanations exist? What would confirm this is causal?"

Mistake 3: Not Specifying Business Context

❌ "Analyse this sales data" ✅ "Analyse this sales data. Context: preparing for a board meeting to explain Q3 underperformance and present a Q4 recovery plan."

Mistake 4: Ignoring Data Quality

❌ Running analysis on data that hasn't been checked for errors ✅ Always ask Claude to flag quality issues before any analysis begins

Mistake 5: Not Asking "So What?"

❌ Getting a table of numbers and stopping there ✅ Always follow with: "What does this mean for [business decision]? What actions does this suggest?"
The Core Principle

Analysis should answer something specific. The most powerful prompt in data work is not "analyse this" — it is "what does this mean for [the decision]?" Every table of numbers should end in an action or a recommendation.

Key Takeaways
  • Start with EDA always — Understand the data before analysing it; quality issues caught early prevent corrupted results
  • Business question first — Analysis should answer something specific and connect to a decision
  • The Analysis Tool unlocks more — Execute code, produce real charts, handle larger files iteratively
  • Excel and Sheets work well — Complex formulas, Google Apps Scripts, and narrative summaries all within reach
  • Visualisation matches the message — Choose the chart type that fits what is being shown, not what looks impressive
  • Numbers into narratives — Data only becomes valuable when stakeholders understand it in plain language
  • Always ask "so what?" — Connect findings to decisions and actions; analysis without application is just interesting reading
Assignment

Beginner: Take any spreadsheet used regularly. Ask Claude for a data overview and quality check. See what it surfaces that was previously unnoticed.

Intermediate: Pick a dataset with at least 3 months of data. Ask Claude for time series analysis and a visualisation. Use the narrative template to write an executive summary from the findings.

Advanced: Frame a real business question. Design the full workflow — EDA → cleaning → statistical analysis → visualisation → narrative → business recommendations. Execute it with Claude end to end.

Reflection questions: What did EDA reveal that was not previously known about the data? Did correlation analysis surface any relationships that were unexpected? How did turning the numbers into a narrative change the understanding of them?

Frequently Asked Questions

Claude can perform exploratory data analysis (understanding structure, patterns, and quality issues), descriptive statistics (mean, median, standard deviation, percentiles), correlation analysis between variables, time series trend analysis including seasonality and anomaly detection, cohort analysis and segmentation, data cleaning and transformation, and generating Python or JavaScript visualisation code. It can also turn quantitative findings into plain-language narratives for any audience.

The Analysis Tool (also called Code Interpreter) allows Claude to execute code, produce real charts and tables from actual data files, handle larger datasets that would exceed the plain chat context limit, and iterate on results within a single session. Use plain chat when you need quick calculations on small pasted datasets, conceptual guidance, or code to run yourself later. Use the Analysis Tool when you have an actual data file to upload, want real rendered visualisations, or need iterative exploratory analysis.

Always start with a data overview request before any specific analysis. Ask Claude to describe the file contents, column names and data types, row count, time period covered, any obvious data quality issues such as missing values or inconsistent formats, and which analyses would be most valuable. This prevents wasted analysis on dirty data, surfaces issues that could corrupt results, and ensures Claude's understanding of the data structure matches reality before deeper work begins.

Claude can write complex Excel and Google Sheets formulas that would take an hour to research manually — including nested IF logic, VLOOKUP replacements, dynamic array formulas, and conditional calculations. It can also write Google Apps Scripts for automated recurring workflows such as weekly email summaries, data aggregation across sheets, and conditional formatting triggers. When uploading an Excel file directly, Claude can read values across all sheets, analyse the data, and produce narrative summaries.

Provide Claude with the key metrics or analysis findings and specify the document type (executive summary, board update, team report), the intended audience (CFO, all-hands, investors, technical team), and the desired length. Ask Claude to lead with the most important finding, use specific numbers to support claims, explain trends in plain language, and end with clear implications or recommended actions. Avoid passive voice and hedging language — specify that active voice and confident conclusions are required.