Don't stop here
Hand-picked guides our readers explore right after this one.
AI prompts for Excel formulas, macros, data analysis, automation, and dashboards
Read the guideExpert guide to Claude prompts with XML tags, artifacts, and complex reasoning
Read the guideGenerate production-ready React and Next.js UI components with v0 by Vercel
Read the guideMost Google Sheets users spend hours on tasks that formulas and Apps Script can handle automatically. Writing QUERY functions by hand requires SQL knowledge most people do not have. Building automation with Apps Script requires JavaScript most people never learned. AI removes both barriers entirely. These 50 prompts cover the full Sheets workflow: formula writing, data cleaning, QUERY, IMPORTRANGE, dashboards, and full automation scripts.
Google Sheets has three features that are extremely powerful but have high learning curves that most users never clear: the QUERY function, Apps Script automation, and advanced formula combinations with ARRAYFORMULA, REGEXEXTRACT, and dynamic arrays. AI removes all three barriers simultaneously. Instead of spending an afternoon learning SQL-like QUERY syntax, you describe the filter you want and get the formula. Instead of a weekend learning JavaScript for Apps Script, you describe the automation and get working code. The payoff is not incremental. It changes what is possible for someone without a technical background.
QUERY uses SQL-like syntax to filter, sort, aggregate, and pivot data in a single formula. It replaces most PivotTables for users who know how to use it. AI writes QUERY formulas from plain-English descriptions, making this the single most valuable unlock for non-technical Sheets users.
Apps Script is JavaScript that automates Google Workspace: send emails from row data, create Docs from templates, sync data between sheets, build menus. ChatGPT writes production-ready Apps Script from a plain description of the task, the trigger, and the data layout.
IMPORTRANGE pulls live data from other Google Sheets into a master sheet, enabling real-time dashboards and consolidated reporting without manual copy-paste. AI helps structure IMPORTRANGE formulas and troubleshoot the access errors and REF issues that catch users off guard.
In 2026, Google Gemini is natively integrated into Google Sheets for Workspace Business and Enterprise subscribers. Gemini can see your actual sheet data and generate formulas or tables in context. For basic operations directly on your data, Gemini is the faster tool. For complex multi-step formulas, Apps Script with error handling, IMPORTRANGE architectures, and situations where you need to understand the logic rather than just get the output, ChatGPT and Claude prompts remain the more powerful option.
Google Sheets prompts fail for predictable reasons. These six steps eliminate the most common failure modes.
Always say Google Sheets explicitly. Excel and Sheets share most formula syntax but diverge on QUERY, dynamic arrays, SORT vs SORTN, Apps Script vs VBA, and UNIQUE function arguments. Without this, AI may write a formula or script that only works in Excel.
Instead of column A and B, say: Column A is customer email (text), Column B is purchase date (MM/DD/YYYY), Column C is order value (number). Row 1 is headers, data starts row 2. Column context is the single most important input for formula accuracy.
Do not try to write QUERY syntax yourself. Instead say: I want to show only rows where column C is greater than 100, sorted by column B descending, showing only columns A, B, and D. ChatGPT translates this into correct QUERY syntax including the header row parameter.
The two essential App Script inputs are trigger (when the form is submitted, daily at 8am, when cell A1 changes) and action (send an email to the address in column B, create a Google Doc named after column A). Include the sheet name and relevant column layout.
IMPORTRANGE errors have specific causes: access not granted, range reference wrong, source sheet renamed, or circular reference. Paste the exact error message and describe your setup. AI diagnostic accuracy for IMPORTRANGE errors is high when given the full error text.
ARRAYFORMULA wraps other formulas to apply them to an entire column without dragging down. The syntax interaction with functions like IF, IFERROR, and VLOOKUP is non-obvious. Always ask ChatGPT to explain ARRAYFORMULA combinations step by step before using them on real data.
The right AI tool depends on task complexity and whether you need to understand the output or just get it.
| Sheets Task | Best Approach | Notes |
|---|---|---|
| Write a QUERY formula to filter and aggregate data | ChatGPT or Claude prompt | Describe the SQL intent in plain English. ChatGPT writes correct QUERY syntax including the header row parameter. |
| Basic formulas (SUM, IF, VLOOKUP, COUNTIF) | Gemini in Sheets or ChatGPT | Gemini can see your data directly for basic formulas. ChatGPT gives better explanations for learning. |
| Write Google Apps Script for automation | ChatGPT or Claude prompt | Describe the trigger and action. Ask for error handling. Test on a copy of your sheet first. |
| IMPORTRANGE setup and error fixing | ChatGPT prompt | Paste the exact error message. ChatGPT diagnoses access, range, and circular reference issues accurately. |
| Build a dashboard with summary formulas | ChatGPT prompt | Describe the 3 questions the dashboard answers and the raw data layout. Get formula plan plus chart recommendations. |
| ARRAYFORMULA for column-wide calculations | ChatGPT prompt | Ask for an explanation alongside the formula. ARRAYFORMULA interactions with IF and IFERROR are non-obvious. |
| Data cleaning (TRIM, SUBSTITUTE, REGEXREPLACE) | ChatGPT or Claude prompt | Paste a sample dirty row. Describe the target format. Get the full cleaning formula including edge cases. |
| GOOGLEFINANCE formulas for stock and currency data | ChatGPT prompt | ChatGPT knows GOOGLEFINANCE attribute names and helps build dynamic financial trackers with date ranges. |
Build powerful formulas, automate workflows, create dashboards, and clean data faster. Expert prompts for Google Sheets users at every skill level.
VLOOKUP with error handling
Write a VLOOKUP formula that: - Looks up the value in cell A2 in the first column of Sheet2!A:D - Returns the value from the 3rd column of that range - Handles cases where no match is found by returning "Not found" instead of #N/A - Also show me the INDEX-MATCH equivalent that achieves the same result
Multi-condition SUMIFS for business reporting
Write a SUMIFS formula that totals sales amounts from column C where: - The date in column A is within the current month - The region in column B matches the value in cell F2 - The status in column D is either "Closed" or "Won" Explain each argument so I can adapt it for other conditions.
ARRAYFORMULA for auto-calculated columns
I want column E to automatically calculate the profit margin for every row: (Revenue in column C - Cost in column D) / Revenue in column C, formatted as a percentage. Write an ARRAYFORMULA that: - Goes in cell E1 and covers all rows automatically as new data is added - Skips the header row - Shows a blank instead of an error when column C is empty
Dynamic tiered commission calculator
Write a formula that calculates commission for sales amounts in column B using these tiers: - 0β$10,000: 5% - $10,001β$50,000: 8% - $50,001+: 12% The commission should apply the correct rate to the full amount (not marginal β flat rate per tier). Show me both a nested IF version and an IFS version.
Normalise messy text data
I have a column of company names that are inconsistent β some are all caps, some lowercase, some with extra spaces, some with "Ltd", "Limited", "Ltd." inconsistently. Write formulas (or an Apps Script) to: 1. Trim extra spaces (leading, trailing, and double-spaces) 2. Convert to proper case (first letter of each word capitalised) 3. Standardise "Limited" / "Ltd." / "Ltd" to "Ltd" Show me the formula approach first, then the Apps Script approach for bulk processing.
Split full names into first and last
Column A contains full names in the format "FirstName LastName". Some entries have middle names too: "FirstName MiddleName LastName". Write formulas to: - Column B: Extract first name only - Column C: Extract last name only (the last word in the string) - Column D: Flag rows that have a middle name (TRUE/FALSE) Handle edge cases where someone has only one name.
Remove duplicates and log changes via Apps Script
Write an Apps Script that: 1. Scans column A for duplicate values (keeping the first occurrence) 2. Deletes all duplicate rows 3. Logs the number of rows deleted and the values that were removed to a "Change Log" sheet with timestamp 4. Sends a summary email to [my email] after completion Add error handling so if something goes wrong, the script logs the error and exits cleanly without partial deletion.
Email validation with formula
Write a formula in column B that validates whether each email address in column A is properly formatted. Mark each cell as: - "Valid" β if it matches standard email format (has @ sign, domain, extension) - "Invalid" β if it's missing @ sign or domain - "Empty" β if column A is blank Use REGEXMATCH. Explain the regex pattern so I can modify it if needed.
Monthly KPI dashboard with auto-update
Design a Google Sheets dashboard structure for tracking these monthly KPIs: Total Revenue, New Customers, Churn Rate, Average Order Value, and MoM Growth %. Include: - Where to put raw data vs summary - QUERY or SUMIFS formulas to pull monthly totals automatically - Conditional formatting rules to flag metrics above/below target - SPARKLINE formulas to show trends in-cell - A drop-down to filter by region or product line
Cohort retention analysis
I have customer transaction data with columns: Customer ID, First Purchase Date, Transaction Date, Revenue. Build a cohort analysis in Google Sheets that: - Groups customers by the month of their first purchase (cohort) - Shows retention rate for each cohort in months 0, 1, 2, 3, 6, 12 - Calculates cumulative revenue per cohort - Uses conditional formatting to heat-map retention (green = high, red = low) Provide both the data structure and the formulas needed.
Sales pipeline tracker with probability weighting
Create a sales pipeline sheet with: - Columns: Deal Name, Stage, Deal Value, Close Date, Probability %, Owner - A weighted pipeline value column (Value Γ Probability) - Summary section showing: Total Pipeline, Weighted Pipeline, Count by Stage - QUERY formula that shows only deals closing in the next 30 days - Conditional formatting: red for past close dates, yellow for <7 days, green for on track
Budget vs actuals variance tracker
Build a budget vs actuals sheet for [monthly/quarterly] tracking with: - Input area for budget figures by category - Input area for actual spend - Variance column (Actual - Budget) with conditional formatting (red = over budget) - % variance column - YTD totals for both budget and actuals - A SPARKLINE trend chart for each category - Alert formula that flags any category more than 10% over budget
Automated invoice generator
Write an Apps Script that generates a PDF invoice from Google Sheets data: - Input sheet has: Client Name, Email, Line Items (description, qty, unit price) - Script calculates subtotal, tax (at rate in cell B1), and total - Creates a formatted invoice in a new sheet - Exports it as PDF to Google Drive in a folder called "Invoices/[Month-Year]" - Emails the PDF to the client email address Include a trigger so it runs when a "Generate Invoice" checkbox is ticked in column H.
Slack or email alert when threshold is crossed
Write an Apps Script that monitors a Google Sheet and sends an alert when: - Inventory in column C drops below the reorder point in column D - A deal in the pipeline sheet changes stage to "Closed Lost" - A budget category exceeds 90% of its budget allocation For each alert, send an email to [email address] with: which item triggered the alert, current value, threshold, and a link to the sheet. Set up the trigger to run every hour.
Form response auto-assignment and notification
I have a Google Form that collects support ticket submissions. Responses go to a Google Sheet. Write an Apps Script (triggered on form submit) that: 1. Assigns each new ticket to a team member from a rotation list in Sheet2!A:A 2. Adds "Assigned" status and assignee name to columns G and H 3. Sends an email to the assignee with ticket details and a link to the sheet 4. Sends a confirmation email to the submitter with their ticket number Include error handling if the rotation list is empty.
Weekly report email with data summary
Write an Apps Script that sends a weekly email report every Monday at 8am containing: - Total revenue for the past 7 days (from the transactions sheet) - Number of new customers this week - Top 3 products by revenue this week - Any budget categories that exceeded their weekly allocation Format the email in clean HTML with a table. Send to a distribution list stored in Sheet2!A:A. Set up the time-based trigger automatically within the script.
QUERY function for dynamic filtering
I have a dataset on Sheet1 with columns: Date, Region, Product, Sales, Returns, Net Sales. Write QUERY formulas for: 1. Show all rows where Region = the value in cell B1 AND Sales > 1000, sorted by Date descending 2. Summarise total Net Sales and count of transactions by Product for the current month 3. Show top 10 products by Net Sales for a date range specified by cells D1 and D2 Explain the QUERY syntax so I can write my own variations.
IMPORTRANGE with dynamic sheet reference
I want to pull data from multiple Google Sheets (one per month) into a master summary sheet. Sheet URLs are stored in column A of my "Sources" tab. Write a solution that: - Uses IMPORTRANGE to pull the "Summary" tab from each source sheet - Combines them into one continuous table on the master sheet - Handles errors gracefully if a source sheet is unavailable - Includes a column showing which source sheet each row came from
Scenario planning model
Build a scenario planning model in Google Sheets with three scenarios: Conservative, Base Case, Optimistic. Structure: - Assumptions section (inputs that change per scenario): growth rate, margin, CAC, churn - Dropdown in cell B1 to select which scenario to view - All calculated outputs update automatically based on selection - Comparison table showing all three scenarios side by side - Key insight row showing which metrics differ most between scenarios Use named ranges and indirect references so the model is easy to maintain.
Live API data integration via Apps Script
Write an Apps Script that fetches data from a public REST API (example: exchange rates from https://api.exchangerate-api.com/v4/latest/USD) and writes it to my Google Sheet: - Fetch the JSON response - Parse the relevant fields (in this case: currency codes and rates) - Write them to a sheet called "Exchange Rates" with headers and today's timestamp - Set a daily trigger to refresh automatically - Handle API errors with a logged error message rather than crashing Show me how to adapt this pattern for any REST API that returns JSON.
Yes, and it is very good at it. Describe what you want the formula to do in plain English, name the columns and what data they contain, and specify Google Sheets (not Excel) so you get the right syntax. ChatGPT handles everything from basic SUM and IF formulas to QUERY, ARRAYFORMULA, IMPORTRANGE, REGEXEXTRACT, and complex nested functions. The key is specificity: tell it column letters, row numbers, and any edge cases like blank cells or mixed data types.
QUERY is Google Sheets' most powerful built-in function and one that confuses most users because it uses SQL-like syntax. You write QUERY(data_range, "SELECT A, B WHERE C > 100 ORDER BY B DESC", 1) to filter and sort data without PivotTables. AI makes QUERY accessible: describe the filter or aggregation you want in plain English and ask ChatGPT to write the QUERY formula. This unlocks capabilities that previously required Sheets expertise. QUERY can replace most PivotTables for users who learn to use it via AI-generated examples.
Yes, via Google Apps Script. Apps Script is JavaScript that runs in Google Workspace and can automate Sheets, Docs, Gmail, Calendar, and Forms. ChatGPT writes Apps Script well when you describe the task: send a Gmail to each email address in column B with the subject in column C when column D says Pending. Describe the trigger (on form submit, daily at 9am, when a cell changes), the data layout, and the action you want. Test scripts on a copy of your Sheet before running on real data.
A few critical differences. Google Sheets has the QUERY function (no Excel equivalent), IMPORTRANGE for pulling data between sheets, GOOGLEFINANCE for stock data, and REGEXEXTRACT/REGEXMATCH for text parsing. Automation uses Apps Script not VBA. Some Excel functions work differently in Sheets (VLOOKUP column index behaves the same, but UNIQUE, FILTER, and SORT syntax differs). Always specify Google Sheets in your prompt so you get Sheets-specific syntax and do not receive VBA or Excel 365-only function suggestions.
Gemini in Google Sheets (available in Google Workspace Business and Enterprise plans) lets you create tables, generate formulas, and analyse data directly in the Sheets interface via natural language. For basic tasks with your actual data visible, Gemini is faster because it can see the sheet context. For complex QUERY formulas, Apps Script, IMPORTRANGE logic, multi-step automation, or when you need to understand the formula rather than just get one, ChatGPT or Claude prompts give more detailed explanations and handle more edge cases.
IMPORTRANGE pulls data from another Google Sheet using IMPORTRANGE(spreadsheet_url, range_string). The three most common errors: first, the first time you use IMPORTRANGE, Sheets asks you to allow access between the two sheets and you must click Allow in the cell popup. Second, changes to the source sheet structure (inserting columns) break the range reference. Third, if the source sheet has a large range, Sheets slows down because IMPORTRANGE recalculates on every open. Ask ChatGPT to help you structure the formula and troubleshoot specific error messages including REF, N/A, and the loading spinner that never resolves.
Yes. Describe the three to five questions your dashboard should answer, who the audience is, and what data is available. ChatGPT will recommend chart types, layout, and formulas for summary metrics. The most useful dashboard prompt pattern is: I have raw sales data in Sheet1 with columns [list]. I want a dashboard on Sheet2 that shows monthly revenue trend, top 5 products by units sold, and region breakdown. Write the formulas for each summary cell and tell me which chart type fits each metric. This gives you a complete build plan rather than generic advice.
Paste a sample row into your prompt and describe the problem: inconsistent date formats, names with extra spaces, phone numbers with dashes and parentheses mixed, addresses split across columns. ChatGPT gives you the specific TRIM, CLEAN, SUBSTITUTE, REGEXREPLACE, TEXT, or SPLIT formulas to fix each issue. For data cleaning pipelines that run regularly, it can also write Apps Script that processes new rows automatically. Data cleaning is one of the highest-ROI uses of AI in Sheets because the formulas involved are specific and difficult to remember without documentation.
ChatGPT writes Apps Script reliably for: sending emails based on sheet data (triggered on edit, form submit, or time), creating Google Docs or Slides from Sheets row data, auto-formatting cells based on values, protecting ranges programmatically, pulling data from external APIs into a sheet, and setting up time-based triggers for reports. For all of these, describe the task in plain English, specify the column layout, name the trigger, and ask for error handling. The generated code is usually 80 to 90 percent correct and needs only minor testing adjustments.
Yes, and the most effective ones follow a consistent structure: In Google Sheets, column A contains [data type], column B contains [data type]. I need a formula in column C that [desired output]. Handle the edge case where [specific situation]. Explain each part of the formula. For Apps Script: Write a Google Apps Script for [trigger] that reads [data] from [sheet/range] and [action]. Add error handling for [specific failure mode]. The prompts in this library follow these structures and cover the most common Sheets workflows.
60+ prompts for Excel formulas, VBA macros, PivotTables, Power Query, and data cleaning. Covers every Excel version.
Build and improve presentations with AI: slide structure, speaker notes, design guidance, and content prompts.
The complete guide to AI tools for business across productivity, analytics, communication, and automation.
Prompts for every section of a business plan: executive summary, market sizing, financials, and GTM strategy.
Founder-specific prompts for product development, fundraising, operations, and investor communications.
Advanced techniques for better AI results: CFPO loops, meta-prompting, and systematic prompt testing.