How to Use Claude for Spreadsheets and Excel Work
By the end of this guide you will know how to make Claude write and debug spreadsheet formulas, generate ready-to-import data, build VBA and Apps Script macros, and analyze a workbook you paste or upload. You will also know which Claude model to pick and how to avoid the few things Claude cannot do directly with a live spreadsheet.
Claude is a strong spreadsheet partner because it is built for text, code, and long-context analysis. It will not open Excel or Google Sheets and click around for you. What it does well is turn plain-English intent into formulas, scripts, and structured data, and reason over a workbook you give it. That covers most of the work most operators actually need.
What Claude can and cannot do with spreadsheets
Set expectations first so you do not fight the tool. Claude reads and reasons over text and tables, and it can see screenshots because image input is supported. It cannot generate images, and it does not have a live cursor inside your sheet. You bring the data in as text, an upload, or a screenshot, and Claude gives you back formulas, code, or analysis you paste in.
- Writing and explaining Excel, Google Sheets, and LibreOffice formulas
- Debugging a formula that returns #REF!, #VALUE!, or the wrong number
- Generating clean CSV or tab-separated data you can paste or import
- Writing VBA macros and Google Apps Script automations
- Converting messy data into a normalized table
- Analyzing a pasted or uploaded dataset and summarizing what it shows
- Open or edit a live Excel or Sheets file with a pointer (no in-app cursor)
- Generate charts as images (it gives you formulas, code, or chart specs instead)
- Run your workbook's calculations natively unless you give it the data
Step 1: Pick the right model
Match the model to the job. Start spreadsheet formulas, debugging, and analysis on Sonnet 5, the default on Claude Free and Pro and an available API model. Evaluate large multi-step builds and quick high-volume cleanup separately, and switch only when the alternative passes your spreadsheet accuracy checks.
- Sonnet 5: current starting point for formulas, debugging, and most analysis
- Opus 4.8: large builds, multi-sheet macros, long multi-file analysis
- Haiku 4.5: fast bulk cleanup and simple repetitive formulas
Opus 4.8 and Sonnet 4.6 both support a 1M-token context window at a flat rate with no surcharge. That means you can paste a very large dataset or several CSV exports in one shot without paying extra for the long window. Haiku 4.5 tops out at 200K tokens, so use Sonnet or Opus for the big stuff.
Step 2: Get a formula written or fixed
Tell Claude the platform, the data layout, and the exact outcome you want. The more concrete you are about column letters and headers, the more often the formula drops in clean. Always state whether you are in Excel or Google Sheets, since functions and syntax differ.
- Platform: 'I'm in Excel 365' or 'I'm in Google Sheets'
- Layout: 'Column A has dates, column B has sales amounts, headers in row 1'
- Goal: 'I want the total of column B for rows where the month in A is March'
- Ask: 'Give me one formula for cell D2 and explain it in one line'
For a broken formula, paste the exact formula, the exact error, and a couple of sample rows. Example prompt: 'This Excel formula returns #VALUE!. Here is the formula and three sample rows. Tell me why it fails and give me the corrected version.' Claude will explain the cause, not just hand back a fix, which matters when the same mistake will recur across your sheet.
Step 3: Generate data you can import
Claude is excellent at producing structured data on demand. Ask for CSV or tab-separated values explicitly so you can paste straight into a sheet or import as a file. Specify the columns, the row count, and any rules. Example: 'Generate 50 rows of sample CRM data as CSV with columns: company, contact, email, stage, deal_size. Stages should be one of Lead, Qualified, Won, Lost. Output only the CSV.'
End data prompts with 'Output only the CSV, no commentary.' Otherwise Claude may wrap the table in helpful explanation that breaks your paste or import. For real data with edge cases, also say 'use a comma as the delimiter and wrap any field containing a comma in double quotes' so the import does not split columns wrong.
Step 4: Automate with VBA or Apps Script
When a task is repetitive, ask for a macro instead of a formula. Claude's agentic coding is strongest in its class, so it handles VBA for Excel and Google Apps Script for Sheets well. Describe the trigger, the input, and the output. Example: 'Write a Google Apps Script that, when I run it, loops every row in the active sheet, and if column C is empty, fills it with the value Pending. Add a custom menu item to run it.'
- The platform and where the script lives (VBA module, or Apps Script bound to the sheet)
- The exact input range and the exact output you expect
- Any conditions or edge cases (empty cells, duplicates, headers to skip)
- Whether you want it triggered manually, on edit, or on a schedule
Step 5: Analyze a workbook you give it
To get analysis, you have to bring the data to Claude. Three ways work: paste the table as text, upload a CSV or spreadsheet file, or paste a screenshot of the cells since image input is supported. Then ask a specific question. Vague asks get vague answers, so name the metric. Example: 'Here is a CSV of monthly revenue by region. Tell me which region grew fastest quarter over quarter and give me the numbers behind it.'
For recurring analysis, set up a Claude Project and drop your standard reference files in once, so every chat starts with context. If you want Claude to pull data from a live source or tool instead of pasting, the Model Context Protocol connects it to systems directly. Anthropic created MCP and supports it first-class, so a connected setup can let Claude read from a database or a sheets connector as part of an agent workflow.
Do not trust a number Claude computes by hand over a large pasted table. For real arithmetic on many rows, ask it to write the formula or script that does the calculation, then run that in your sheet. Use Claude to build the logic, and let the spreadsheet do the math. That keeps you fast and accurate.
Step 6: Save money on heavy or repeated jobs
If you are processing spreadsheet data through the API at volume, two levers cut cost hard. Batch processing runs jobs at 50% off when you do not need an instant answer, which fits overnight data cleanup. Prompt caching gives up to 90% off cached input, which is ideal when you reuse the same large reference table or instructions across many runs. On consumer plans, Free, Pro, and Max all work for interactive spreadsheet help.
- Sonnet 4.6: $3 in / $15 out
- Opus 4.8: $5 in / $25 out (Fast Mode $10 / $50)
- Haiku 4.5: $1 in / $5 out
- Batch: 50% cheaper; prompt caching: up to 90% off cached input
Get the Claude playbook in your inbox.
One weekly email for Claude and Claude Code users. Real workflows, no hype. Subscribe and we send you The Claude Power-User Cheatsheet.