Claude Prompt Library

Google Sheets Workflows Claude Reasons Through

20 copy-paste prompts

20 Claude prompts for QUERY functions, Apps Script automations, data cleaning pipelines, and the multi-step Google Sheets problems where Claude's structured thinking helps.

In short: This page contains 20 copy-paste ready prompts, organized into 4 categories with a description and pro tip for each. The first 5 prompts are free instantly, no signup needed. Drafted with AI writing assistance and checked against our editorial policy.

Louis Corneloup
By Louis Corneloup · Founder, Techpresso
Last updated ·Drafted with AI assistance (how we make prompts)

Formulas & QUERY

5 prompts

QUERY Function Builder

1/20

✨ What it does

Claude writes a QUERY for [need] over [range] with SELECT, WHERE, GROUP BY, ORDER BY, and LIMIT explained, plus a FILTER/SORT fallback. Map the columns, then paste the QUERY and compare it to your pivot.

<task>Write Google Sheets QUERY for [need]</task> <data_location>[range]</data_location> <columns>[describe]</columns> <output> 1. QUERY with SELECT/WHERE/GROUP BY/ORDER BY/LIMIT 2. Explain each clause 3. Dynamic inputs via concat 4. Non-QUERY alternative with FILTER/SORT 5. When QUERY beats pivot </output>

💡

Pro tip: QUERY is Sheets' secret weapon — essentially SQL inside a cell. Learn SELECT/WHERE/GROUP BY and you replace 80% of complex formulas.

ARRAYFORMULA Rewriter

2/20

✨ What it does

Claude converts the dragged formula you [paste] into one ARRAYFORMULA, explaining the spill, functions that will not vectorize, and speed versus drag. Apply it to [describe] the range, then delete the old dragged copies once your spill looks clean.

<task>Convert dragged formula to ARRAYFORMULA</task> <formula>[paste]</formula> <range>[describe]</range> <output> 1. Single ARRAYFORMULA 2. How spill works 3. Functions that don't vectorize 4. Performance vs dragged </output>

💡

Pro tip: ARRAYFORMULA replaces 1,000 dragged cells with 1 cell. Maintainability skyrockets, performance improves, doesn't break when new rows add.

Complex Formula Builder

3/20

✨ What it does

Claude builds a Sheets formula for [calculation] with each part explained, IFERROR wrapping, and an ARRAYFORMULA option for [blanks, errors]. Test it on a blank cell, then fill the column only after your error wrap looks right.

<task>Build Google Sheets formula for [calculation]</task> <data>[describe]</data> <edge_cases>[blanks, errors]</edge_cases> <output> 1. Formula in Sheets syntax 2. Each part explained 3. IFERROR wrapping 4. ARRAYFORMULA version if helpful </output>

💡

Pro tip: Sheets formulas differ subtly from Excel — comma vs semicolon by locale, different array behavior. Specify locale if you hit syntax errors.

Advanced Lookup

4/20

✨ What it does

Claude builds an advanced lookup for [scenario] with XLOOKUP, FILTER, or INDEX-MATCH, a missing-match fallback, case handling, and speed notes. Try it on a known miss, then keep the version that stays fast on your sheet.

<task>Build advanced lookup for [scenario]</task> <output> 1. XLOOKUP / FILTER / INDEX-MATCH as appropriate 2. Fallback for missing matches 3. Case sensitivity handling 4. Performance notes for large data </output>

💡

Pro tip: VLOOKUP in Sheets is obsolete. XLOOKUP handles errors better, works any direction. Switching is the biggest readability upgrade you can make.

IMPORTRANGE Setup

5/20

✨ What it does

Claude sets up IMPORTRANGE from [source] to [target] with the formula, authorization steps, errors, rate limits, and an Apps Script fallback. Grant access on a test tab, then switch to Script if your import keeps failing.

<task>Set up IMPORTRANGE between [source] and [target]</task> <output> 1. Formula 2. Authorization flow 3. Error handling 4. Rate limits 5. Apps Script alternative for reliability </output>

💡

Pro tip: IMPORTRANGE breaks silently on renames/permissions. For critical sheets, use Apps Script copy instead. One-click convenience isn't worth silent breakage.

Apps Script

5 prompts

Apps Script Generator

6/20

✨ What it does

Claude writes Apps Script for [purpose] with comments, scopes, trigger setup for [manual / onEdit / time-driven], logging, and a dry-run. Describe the sheet, then run the dry-run before you attach the live trigger.

<task>Write Apps Script for [purpose]</task> <sheet_structure>[describe]</sheet_structure> <trigger>[manual / onEdit / time-driven]</trigger> <output> 1. Complete script with comments 2. Authorization scopes 3. Trigger setup 4. Error handling + logging 5. Dry-run test </output>

💡

Pro tip: Apps Script is Sheets' VBA, but cloud-native. Claude writes defensive scripts with try/catch + logging — far safer than most tutorial examples.

Custom Menu / Sidebar

7/20

✨ What it does

Claude builds a custom menu from the items you [list], with onOpen, one function per action, optional sidebar HTML, and install steps. Reload the sheet, then click each menu item on dummy data before your team sees it.

<task>Build custom menu for my sheet</task> <menu_items>[list]</menu_items> <output> 1. onOpen() function 2. Each action as function 3. Sidebar HTML if needed 4. Installation instructions </output>

💡

Pro tip: Custom menus make Sheets feel like apps. 20 minutes saves 100 "how do I run this?" questions from teammates.

Email Automation

8/20

✨ What it does

Claude writes a sheet-driven email script for the use case you [describe], with templates, quotas, a log-only dry-run, and a kill-switch. Run the dry-run, then send a copy to your inbox before any real list.

<task>Automate emails from sheet</task> <use_case>[describe]</use_case> <output> 1. MailApp/GmailApp script 2. Template with variable substitution 3. Quota management 4. Dry-run via logs 5. Kill-switch </output>

💡

Pro tip: Apps Script has 100-email quota on free / 1,500 on Workspace. Always dry-run first — one buggy script can blast your whole contact list.

Scheduled Refresh

9/20

✨ What it does

Claude builds a scheduled refresh from [API / sheet / system] with fetch logic, a time trigger, error mail, archival, and rate-limit handling. Set the cadence you [describe], then watch one run and the error path on your sheet.

<task>Build scheduled refresh script</task> <source>[API / sheet / system]</source> <schedule>[describe]</schedule> <output> 1. Fetch/sync logic 2. Time trigger 3. Error notifications 4. Data archival 5. Rate limit handling </output>

💡

Pro tip: Scheduled scripts fail silently are worse than no automation. Always wrap in try/catch + email on failure. Knowing it broke beats the automation itself.

Two-Way Sync

10/20

✨ What it does

Claude designs two-way sync between [A] and [B] with source-of-truth rules, scripts both ways, unique IDs, conflict handling, and an audit log. List the fields, then sync a handful of rows before you turn it loose.

<task>Design two-way sync between [A] and [B]</task> <fields>[list]</fields> <output> 1. Source of truth per scenario 2. Apps Script for both directions 3. Unique ID strategy 4. Conflict resolution 5. Audit log </output>

💡

Pro tip: Two-way sync is hard. Conflicts and deletions bite fast. If one side can be read-only, pick one-way. Only go two-way when truly necessary.

Data Transformation

5 prompts

REGEX Data Cleaner

11/20

✨ What it does

Claude writes a REGEX cleaning sequence for [paste 5-10 rows], with EXTRACT/REPLACE, ARRAYFORMULA, and a verification QUERY. Run it on the samples, then apply the ARRAYFORMULA only after your QUERY looks clean.

<task>Clean messy data with REGEX</task> <samples>[paste 5-10 rows]</samples> <issues>[describe]</issues> <output> 1. Cleaning sequence 2. REGEXEXTRACT/REGEXREPLACE formulas 3. ARRAYFORMULA application 4. Verification QUERY </output>

💡

Pro tip: REGEX unlocks most cleanup tasks — extracting emails from paragraphs, phone numbers from strings, dates from text. 30 minutes learning regex pays back 100×.

Duplicate Handling

12/20

✨ What it does

Claude flags duplicates in [range] as [exact / fuzzy], with a merge plan, near-matches, a clean output sheet that keeps the original, and an optional auto-dedupe script. Review the flags, then write the clean sheet, not over your source.

<task>Handle duplicates in [range]</task> <definition>[exact / fuzzy]</definition> <output> 1. QUERY/formula to flag duplicates 2. Merge strategy 3. Near-match handling 4. Output to clean sheet (preserve original) 5. Auto-dedupe script option </output>

💡

Pro tip: Never delete duplicates from original data. Copy to clean sheet first. Saves you when "those weren't duplicates" conversations happen.

Transformation Pipeline

13/20

✨ What it does

Claude builds a raw-to-analysis pipeline with ordered transforms, methods, a Raw to Staging to Clean to Analysis layout, checks, and refresh steps. Describe both ends, then refresh from Raw once before you trust Analysis.

<task>Build data pipeline from raw to analysis-ready</task> <raw>[describe]</raw> <target>[describe]</target> <output> 1. Transformations in order 2. Method per step 3. Sheet layout (Raw → Staging → Clean → Analysis) 4. Validation between stages 5. Refresh instructions </output>

💡

Pro tip: "One sheet per stage" is the winning pattern. Raw → Staging → Clean → Analysis. Mixing stages in one sheet makes debugging impossible.

Form Response Processor

14/20

✨ What it does

Claude processes Form submissions from the fields you [list] with [auto-categorize / route / email], onFormSubmit, confirmation mail, and a dashboard. Submit a test form, then turn on the trigger after your test routes correctly.

<task>Process Google Form submissions</task> <fields>[list]</fields> <actions>[auto-categorize / route / email]</actions> <output> 1. Response sheet formulas 2. onFormSubmit trigger 3. Conditional routing logic 4. Confirmation email 5. Dashboard summary </output>

💡

Pro tip: Forms + Sheets + Apps Script = free CRM / helpdesk / registration. Before paying SaaS, check if this combo solves 80% of your need. Usually does.

Performance Optimization

15/20

✨ What it does

Claude diagnoses a slow Sheet of [rows × cols], ranks volatile replacements, when to split, and when to move to BigQuery Connected. Reproduce the [describe] lag, then apply one fix and retime before your next change.

<task>Optimize slow Sheet</task> <size>[rows × cols]</size> <symptoms>[describe]</symptoms> <output> 1. Slow elements identified 2. Volatile formula replacements 3. When to split sheets 4. When to move to BigQuery Connected </output>

💡

Pro tip: Sheets comfortable max is ~5M cells. Past 1M rows, move to BigQuery + Connected Sheets. Keep UX; gain database performance.

These prompts give you the what. Tutorials give you the why.

Learn when to use extended thinking, how to build Claude Projects, and workflows that compound. The library keeps growing.

Try AI Academy Free

Dashboards & Sharing

5 prompts

Interactive Dashboard

16/20

✨ What it does

Claude builds a Sheets dashboard for the purpose you [describe], with tab layout, KPI QUERY formulas, dropdown slicers, charts, and mobile notes. Click each slicer on your phone, then hide tabs viewers should not see.

<task>Build dashboard in Sheets</task> <purpose>[describe]</purpose> <output> 1. Tab layout 2. KPI formulas / QUERY 3. Drop-down slicers with FILTER/QUERY 4. Chart design 5. Mobile view notes </output>

💡

Pro tip: Sheets lacks native slicers, but drop-downs + FILTER/QUERY approximate them. 90% as good, 100% as free.

BigQuery Connected Sheets

17/20

✨ What it does

Claude sets up Connected Sheets with BigQuery for the use case you [describe], covering prep, connection, pivot behavior, refresh, and cost. Run a cheap query first, then schedule refresh only after you see the bill pattern.

<task>Set up Connected Sheets with BigQuery</task> <use_case>[describe]</use_case> <output> 1. BigQuery prep 2. Connection setup 3. Pivot/chart behavior 4. Refresh scheduling 5. Cost considerations </output>

💡

Pro tip: Connected Sheets is Google's best-kept Workspace secret. Analyze billions of rows in pivot tables. If your company uses BigQuery, this is non-negotiable.

Sheet Governance

18/20

✨ What it does

Claude designs governance for a shared sheet used by [number] people, with protected ranges, permission tiers, named versions, edit alerts, and a how-to tab. Name the [describe] issues, then lock the input ranges on your sheet this week.

<task>Design governance for shared sheet</task> <team_size>[number]</team_size> <issues>[describe]</issues> <output> 1. Protected ranges strategy 2. Permission tiers 3. Named versions workflow 4. Edit alerts 5. "How to use" tab </output>

💡

Pro tip: Shared sheets without governance become graveyards. Lock formulas, open input ranges, name critical versions. 1 hour saves 100 broken-formula mysteries.

Slides Report Generator

19/20

✨ What it does

Claude writes Apps Script that reads the sheet and builds a Slides deck from template placeholders, with chart insert options, a trigger, and email delivery. Build the template first, then generate one deck and check every placeholder on your side.

<task>Automate Slides from Sheet data</task> <output> 1. Apps Script reading sheet + writing Slides 2. Template with {{variable}} placeholders 3. Chart insertion (linked vs pasted) 4. Trigger + email delivery </output>

💡

Pro tip: Weekly executive decks that took hours become one-click buttons. Template once, automate once, save forever.

Mail Merge to Docs

20/20

✨ What it does

Claude builds a Sheet-to-Docs mail merge for [contracts / invoices / letters], with one Doc per row, placeholders, folders, PDF, and email. Generate one sample PDF, then send it to your own inbox before the full run.

<task>Build mail merge Sheet → Docs/PDF</task> <use_case>[contracts / invoices / letters]</use_case> <output> 1. Apps Script generating one Doc per row 2. Placeholder replacement 3. File naming + folder organization 4. PDF conversion 5. Email delivery </output>

💡

Pro tip: Paid mail-merge tools charge $10-50/month for what Apps Script does free. Learn the pattern once, generate thousands of personalized docs in minutes.

Free tool

Formula Genie

Describe what you need and get the exact Excel or Google Sheets formula.

Try it free →

Frequently Asked Questions

Claude's step-by-step reasoning handles complex QUERY formulas, Apps Script debugging, and multi-step data transformations particularly well. It's also good at writing defensive Apps Script with proper error handling.
Yes, very reliably — with proper error handling, authorization scopes, and trigger setup. Always test in a copy first. Claude's defensive coding style prevents most runtime failures.
Particularly strong at QUERY — Claude thinks in structured SQL-like terms naturally. For complex QUERY formulas with multiple clauses, Claude outperforms quick references.
ARRAYFORMULA for applying a formula across a range. LAMBDA (via Name Manager) for reusable custom functions. Most power users combine both — ARRAYFORMULA wrapping LAMBDA calls.
Over 1M rows or multi-million-cell sheets. Connected Sheets keeps Sheet UX but moves computation to BigQuery. The migration is easier than most think — often an afternoon's work.

Prompts are the starting line. Tutorials are the finish.

A growing library of hands-on tutorials on ChatGPT, Claude, Midjourney, and many other AI tools. New tutorials are added regularly.

7-day free trial. Cancel anytime.