pillar|·13 min read

How to Automate Google Sheets: Complete Guide

Every automation method for Google Sheets explained — from ARRAYFORMULA and macros to Apps Script triggers and add-ons — with real examples and a frank Apps Script vs. Zapier comparison.

NM

Nacho Mascort

Author

Manual spreadsheet work compounds fast. Copy a formula down 500 rows. Paste last week's export. Reformat the dates. Run the report. Do it again next Monday. If any of that sounds familiar, you're spending hours on work that Google Sheets can handle on its own — you just need to know which tool to reach for.

This guide covers every automation method available in Google Sheets, from zero-code formula tricks to full Apps Script pipelines, plus a frank comparison of when to use external tools like Zapier instead.

Why Automating Google Sheets Is Worth the Upfront Investment

Automation is not about writing code. It's about encoding a decision once so you never have to make it again. A formula that auto-classifies incoming leads, a macro that reformats a weekly export, a trigger that emails your team when a cell changes — each removes a manual handoff that would otherwise require someone's attention.

The compounding effect is real: teams that automate repetitive classification tasks report roughly 30% productivity gains on those specific workflows. Scheduled data refreshes can cut reporting cycles by 90% when the alternative is manually pulling data from multiple sources each week.

The other reason to automate: error reduction. Spreadsheets with heavy manual editing reportedly contain critical errors in 94% of cases. Automations don't fat-finger numbers, paste into the wrong column, or forget a step when they're distracted.

Method 1 — Formulas and Functions

Before touching macros or scripts, exhaust what native formulas can do. Several Google Sheets functions are purpose-built for automation — they apply logic dynamically across an entire dataset without any code.

ARRAYFORMULA: Apply Logic to Entire Columns

ARRAYFORMULA lets a single formula process an entire range instead of requiring you to copy it row by row. Wrap any formula that would normally operate on one cell, and it expands automatically to every row in the range.

=ARRAYFORMULA(IF(A2:A="","",B2:B * C2:C))

This formula multiplies column B by column C for every row that has data in column A, and updates instantly when new rows are added. No dragging. No remembering to extend the formula when the sheet grows.

Common uses:

  • Auto-calculate line totals in an order sheet
  • Classify rows based on a value threshold (IF(D2:D>100,"High","Low"))
  • Auto-generate timestamps or sequential IDs

QUERY: SQL-Style Data Automation

QUERY applies a SQL-like statement to a range and returns a filtered, sorted, aggregated result. It's underused by most Sheets users and one of the most powerful automation tools available without code.

=QUERY(Orders!A:F, "SELECT A, B, SUM(F) WHERE D='Completed' GROUP BY A, B ORDER BY SUM(F) DESC", 1)

This pulls completed orders, groups them by columns A and B, sums column F, and sorts by total — all live, updating automatically whenever the source data changes.

Use QUERY to build automated dashboards that pull from a raw data sheet: every time someone updates the source, the dashboard refreshes with no manual intervention.

Conditional Formatting and Data Validation

Conditional formatting automates visual feedback. Data validation automates input constraints. Together they catch errors at entry time rather than after the fact.

Example: highlight any expense row where amount exceeds budget using a custom formula rule:

=D2>E2

Apply that rule to the entire column, and any over-budget row turns red automatically. No manual review required.

Method 2 — Macros

Macros record a sequence of actions you perform manually, then replay them on demand. They're the fastest path to automation for repetitive multi-step tasks that don't involve complex logic.

Recording a Macro

  1. Open your sheet and go to Extensions → Macros → Record macro
  2. Choose Absolute references or Relative references (more on this below)
  3. Perform the actions you want to record: formatting, sorting, copying, pasting, etc.
  4. Click Save and give the macro a name
  5. Optionally assign a keyboard shortcut: Ctrl+Alt+Shift+1 through 9

Once saved, the macro appears under Extensions → Macros and can be run any time.

Absolute vs. Relative References in Macros

This is where most macro problems originate. The reference type determines how the recorded cell positions are interpreted on playback.

Reference Type How It Works Use When
Absolute Always applies to the exact cells recorded (e.g., A1, B2) Formatting a fixed header row, clearing a specific range
Relative Applies relative to the currently selected cell Processing the current row, applying logic to wherever the cursor is

If you record a macro that reformats row 2 using absolute references, it will always reformat row 2 — even if you select row 7 first. Switch to relative references when you want the macro to operate on whichever row you've selected.

Scheduling Macros

Macros can run automatically on a schedule through Apps Script triggers. After recording, your macro becomes a function in the Apps Script editor. Open it via Extensions → Apps Script, then add a trigger:

  1. Click the clock icon (Triggers) in the left sidebar
  2. Click + Add Trigger
  3. Select your macro function, set Time-driven, choose frequency (daily, weekly, hourly)

The macro now runs automatically. No one needs to open the sheet.

Try it with Unlimited Sheets

Unlimited Sheets adds AI, web scraping, and SERP data directly into your Google Sheets with no code. Use UNLIMITED_AI to classify, summarize, or rewrite cell values at scale — automating tasks that formulas and macros can't handle.

Install Free Add-on →

Method 3 — Google Apps Script

Apps Script is Google's built-in JavaScript runtime for Workspace. It's the most powerful automation tool available inside Google Sheets — no external accounts, no subscriptions, no rate limits tied to pricing tiers.

Custom Functions

You can write functions that work exactly like built-in Sheets functions — type them in a cell and they return a value.

/**
 * Converts a USD amount to EUR using a hardcoded rate.
 * @param {number} usd - The USD amount to convert.
 * @return {number} The EUR equivalent.
 * @customfunction
 */
function USD_TO_EUR(usd) {
  return usd * 0.92;
}

Use this in your sheet as =USD_TO_EUR(A2). Wrap it with ARRAYFORMULA to apply it to an entire column at once: =ARRAYFORMULA(USD_TO_EUR(A2:A)).

Time-Based Triggers

Triggers let you run Apps Script functions automatically. Time-based triggers fire on a schedule:

function createDailyTrigger() {
  ScriptApp.newTrigger('syncDataFromAPI')
    .timeBased()
    .everyDays(1)
    .atHour(8)
    .create();
}

This runs syncDataFromAPI every day at 8 AM. The function can fetch external data, write it to the sheet, and send an email summary — all without anyone touching the spreadsheet.

One important constraint: Apps Script functions have a 6-minute execution time limit. For large datasets, use batch processing — break the work into chunks and use a trigger to chain them:

function processBatch() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data');
  const startRow = PropertiesService.getScriptProperties().getProperty('startRow') || 2;
  const batchSize = 200;

  // Process batchSize rows, then save position
  const endRow = parseInt(startRow) + batchSize;
  // ... processing logic ...

  PropertiesService.getScriptProperties().setProperty('startRow', endRow);
}

Event-Based Triggers

Event triggers fire in response to user actions: opening the spreadsheet, editing a cell, submitting a form.

function onEdit(e) {
  const range = e.range;
  const sheet = range.getSheet();

  // Only react to changes in column D of the 'Orders' sheet
  if (sheet.getName() === 'Orders' && range.getColumn() === 4) {
    const status = range.getValue();
    if (status === 'Shipped') {
      sendShippingNotification(sheet, range.getRow());
    }
  }
}

This sends an email notification whenever someone marks an order as "Shipped" in column D. No polling, no manual trigger — it runs the moment the cell changes.

Note: Programmatic writes (from Zapier, scripts, or API calls) do not fire onEdit. That trigger only activates on human input. Use an installable trigger if you need it to respond to script-driven changes.

Method 4 — Add-ons for Extended Automation

The Google Workspace Marketplace offers add-ons that bolt capabilities onto Sheets that would otherwise require custom development. The right add-on can save weeks of Apps Script work.

Unlimited Sheets: AI and Web Data in Formulas

Unlimited Sheets exposes AI, web scraping, and SERP data through native Google Sheets functions. This fills a gap that formulas and macros can't touch: unstructured data from the web and language model processing.

  • UNLIMITED_AI(A2, "Classify this review as Positive, Negative, or Neutral") — run AI classification on any cell
  • AI_SCRAPE(B2, "Extract the product price") — scrape a URL and extract a specific field
  • GET_KEYWORD_POSITION(C2, "google.com") — pull live SERP data for SEO tracking

Wrap any of these with ARRAYFORMULA to process hundreds of rows at once. Combined with time-based triggers that refresh the sheet, you get fully automated pipelines for competitive intelligence, lead enrichment, and content research — all inside Sheets.

Try it with Unlimited Sheets

Pull live web data, run AI analysis, and track keyword rankings directly in your spreadsheet. Free to install — no API keys required to get started.

Install Free Add-on →

Apps Script vs. Zapier: Which Should You Use?

Both tools automate Google Sheets, but they solve different problems. Choosing the wrong one means either writing unnecessary code or paying for something a free script could do.

Factor Google Apps Script Zapier
Cost Free (Google account required) Paid (per task/month)
Coding Yes — JavaScript syntax No — visual builder
External app integrations Google Workspace focused; others via HTTP 6,000+ apps, pre-built connectors
Customization Very high — full code control Limited to available connectors
Auditability Full version history in Drive 30-day edit history, vendor-controlled
Error visibility Precise stack traces in Apps Script logs Can stall silently; limited diagnostics
Execution limits 6-min per run, 90 min/day (free) Based on plan tier

Use Apps Script when:

  • The automation stays entirely within Google Workspace
  • You need cost predictability at high volume
  • Compliance or audit requirements demand versioned code
  • The logic is complex enough that a visual connector won't cover it

Use Zapier when:

  • You need to connect Sheets to a non-Google SaaS tool quickly (Slack, HubSpot, Notion)
  • No one on the team writes JavaScript
  • The volume is low enough that per-task pricing is negligible

The two tools can also work together. Zapier can trigger an Apps Script HTTP endpoint via doPost(), letting you build no-code triggers that kick off complex script logic. Just be aware: Zapier writing data to a Sheets cell does not fire onEdit triggers — those only activate on human input.

Common Mistakes That Break Google Sheets Automations

Most automation failures trace back to a small set of predictable mistakes. Knowing them in advance saves hours of debugging.

Wrong Reference Type in Macros

Recording a macro with absolute references when you need relative (or vice versa) is the most common macro mistake. The symptom: the macro works perfectly the first time, then overwrites the wrong cells on subsequent runs. Re-record with the correct reference type rather than trying to edit the generated script.

Apps Script Hitting the 6-Minute Limit

Long-running scripts that process large datasets in a single pass will time out at 6 minutes. The fix is batch processing: store progress using PropertiesService, process a chunk, then let a trigger restart the function for the next chunk. Never assume a single-pass approach will scale.

Triggers That Fail Silently

Apps Script triggers can fail without surfacing an error in the sheet. Always configure an error notification email in the trigger settings (Edit trigger → Failure notification settings). Otherwise an automation that broke weeks ago looks like it's still running.

Assuming Clean Input Data

Automations built on the assumption that data is always clean will break on the first empty cell, inconsistent date format, or stray space. Add explicit guards:

=ARRAYFORMULA(IF(ISBLANK(A2:A), "", VLOOKUP(A2:A, Lookup!A:B, 2, FALSE)))

The ISBLANK check prevents VLOOKUP from throwing errors on empty rows. Apply similar defensive logic in Apps Script with null checks before operating on cell values.

Oversharing Edit Access

Giving everyone edit access to a sheet with live automations is asking for accidental overwrites. Protect the ranges your scripts write to via Data → Protect sheets and ranges, and assign a single owner for the raw data tab. Let collaborators work in separate input sheets that your script reads from.

Building One Giant Macro

A macro that does ten things is fragile — one step fails and the whole thing breaks. Break complex workflows into small, single-purpose macros or functions that each do one thing. Chain them with a controller function if needed. Small units are easier to debug, update, and reuse.

Frequently Asked Questions

Can I automate Google Sheets for free?

Yes. Formulas, macros, and Google Apps Script are all free with any Google account. Apps Script gives you a JavaScript runtime with time-based and event-based triggers at no cost. The main limits are a 6-minute execution time per run and a 90-minute daily quota on the free tier — enough for most small-to-medium automation workflows.

How do I automate Google Sheets without coding?

Three options: (1) Use ARRAYFORMULA and QUERY to apply formula logic automatically across entire columns. (2) Record macros using Extensions → Macros → Record macro — no code required, just perform the actions. (3) Use a no-code add-on or integration tool like Zapier to connect Sheets to external apps and trigger actions automatically.

How do I run a script automatically when a cell changes?

Use an onEdit(e) function in Apps Script. It fires whenever a user edits a cell. Check e.range.getColumn() and e.range.getSheet().getName() to target specific cells. Note: this trigger only fires on human edits — programmatic writes from scripts or external tools do not activate it.

Can Google Sheets run a script on a schedule?

Yes. In the Apps Script editor, go to Triggers (the clock icon), click + Add Trigger, and configure a time-based trigger. You can set it to run hourly, daily, weekly, or monthly. The function runs in the background even if the spreadsheet is closed.

Should I use Zapier or Apps Script to automate Google Sheets?

Use Apps Script when you need complex logic, cost control, or audit-grade versioning — it's free and stays inside Google Workspace. Use Zapier when you need fast, no-code connections to external SaaS tools (Slack, HubSpot, Salesforce) and the per-task cost is acceptable. For high-volume or compliance-sensitive workflows, Apps Script wins. For rapid cross-app integrations without developers, Zapier wins.

What is ARRAYFORMULA and when should I use it?

ARRAYFORMULA applies a formula to an entire range instead of a single cell. Use it whenever you'd otherwise need to copy a formula down every row: =ARRAYFORMULA(IF(A2:A="","",B2:B*C2:C)). It updates automatically as new rows are added, eliminating the need to extend formulas manually.

What is the Apps Script execution time limit?

Apps Script functions time out after 6 minutes per execution. For large datasets, use batch processing: store your current position with PropertiesService, process a chunk of rows, then let a time-based trigger restart the function for the next batch. This approach handles datasets of any size within the time constraints.

How does Unlimited Sheets extend Google Sheets automation?

Unlimited Sheets adds custom functions for AI processing, web scraping, and SERP data directly in Google Sheets. Functions like UNLIMITED_AI and AI_SCRAPE let you automate tasks that native formulas can't handle — classifying text, extracting data from websites, or tracking keyword rankings — without writing any backend code. Combined with ARRAYFORMULA, you can process entire columns of data automatically.

Try it in your spreadsheet

Install Unlimited Sheets and start tracking keyword rankings with a single formula. Free to start, no credit card required.

Install Free Add-on
#google sheets#automation#apps script#macros#arrayformula#zapier#productivity
Nacho Mascort

Nacho Mascort

Founder at Unlimited Sheets

Spreadsheet power user. Building tools that bring enterprise-grade SEO and data capabilities to Google Sheets.

Frequently Asked Questions

Common questions about this topic

Can I automate Google Sheets for free?
Yes. Formulas, macros, and Google Apps Script are all free with any Google account. Apps Script gives you a JavaScript runtime with time-based and event-based triggers at no cost. The main limits are a 6-minute execution time per run and a 90-minute daily quota on the free tier — enough for most small-to-medium automation workflows.
How do I automate Google Sheets without coding?
Three options: (1) Use ARRAYFORMULA and QUERY to apply formula logic automatically across entire columns. (2) Record macros using Extensions → Macros → Record macro — no code required, just perform the actions. (3) Use a no-code add-on or integration tool like Zapier to connect Sheets to external apps and trigger actions automatically.
How do I run a script automatically when a cell changes?
Use an onEdit(e) function in Apps Script. It fires whenever a user edits a cell. Check e.range.getColumn() and e.range.getSheet().getName() to target specific cells. Note: this trigger only fires on human edits — programmatic writes from scripts or external tools do not activate it.
Can Google Sheets run a script on a schedule?
Yes. In the Apps Script editor, go to Triggers (the clock icon), click + Add Trigger, and configure a time-based trigger. You can set it to run hourly, daily, weekly, or monthly. The function runs in the background even if the spreadsheet is closed.
Should I use Zapier or Apps Script to automate Google Sheets?
Use Apps Script when you need complex logic, cost control, or audit-grade versioning — it's free and stays inside Google Workspace. Use Zapier when you need fast, no-code connections to external SaaS tools (Slack, HubSpot, Salesforce) and the per-task cost is acceptable. For high-volume or compliance-sensitive workflows, Apps Script wins. For rapid cross-app integrations without developers, Zapier wins.
What is ARRAYFORMULA and when should I use it?
ARRAYFORMULA applies a formula to an entire range instead of a single cell. Use it whenever you'd otherwise need to copy a formula down every row: =ARRAYFORMULA(IF(A2:A="","",B2:B*C2:C)). It updates automatically as new rows are added, eliminating the need to extend formulas manually.
What is the Apps Script execution time limit?
Apps Script functions time out after 6 minutes per execution. For large datasets, use batch processing: store your current position with PropertiesService, process a chunk of rows, then let a time-based trigger restart the function for the next batch. This approach handles datasets of any size within the time constraints.
How does Unlimited Sheets extend Google Sheets automation?
Unlimited Sheets adds custom functions for AI processing, web scraping, and SERP data directly in Google Sheets. Functions like UNLIMITED_AI and AI_SCRAPE let you automate tasks that native formulas can't handle — classifying text, extracting data from websites, or tracking keyword rankings — without writing any backend code. Combined with ARRAYFORMULA, you can process entire columns of data automatically.

Stop overpaying for SEO tools

Get keyword rankings, search volumes, SERP data, and AI — all inside Google Sheets. One add-on, one formula.