Automate Google Sheets Reports Apps Script: A Beginner's Walkthrough
Learn to automate Google Sheets reports Apps Script in a few clear steps: build a script, email the summary, and set a trigger to run it on schedule.
By Galactic News Editorial · Published 2026-11-27T02:13:42+00:00 · Updated 2026-11-27T02:13:42+00:00
If you still copy numbers out of a spreadsheet every Monday morning, there is a better way. Google Apps Script is a free scripting tool built into Google Sheets. With a short script and a time-driven trigger, your sheet can build a report and email it to you on a schedule. No add-ons, no paid tools, and no coding background are needed. This walkthrough shows you how to automate Google Sheets reports Apps Script, from a blank sheet to a report that sends itself.
What Apps Script Is and What It Can Do
Apps Script is a scripting language based on JavaScript. It runs on Google's servers, not on your computer. That matters, because it means a script can run while your sheet is closed and your computer is off.
Three built-in services do most of the work for reports. SpreadsheetApp reads values from your sheet. GmailApp sends email. ScriptApp creates triggers that run a function on a schedule. Together, they cover the whole job: read the data, build a summary, and send it.
Triggers are the part that turns a script into automation. A time-driven trigger, also called a clock trigger, runs a function at a set time or on a recurring interval. Google's own documentation describes it as similar to a cron job in Unix. It can run as often as every minute or as rarely as once a month. One detail to know: the time is slightly randomised. A trigger set for 9 AM will run at some point between 9 and 10 AM, then keep that timing day after day.
Triggers always run under the account of the person who created them. That account's email quota is used when the script sends mail. Keep that in mind if several people share the sheet.
How to Automate Google Sheets Reports Apps Script
Follow these steps in order. Each one takes a few minutes, and you can test as you go.
Step 1: Prepare Your Sheet
A script can only read what it can find. Give your data one header row, with a clear label in every column. Put dates in one column and numbers in their own columns. Avoid merged cells and blank header cells. If your data has a date column and an amount column, the script below will work with almost no changes.
Step 2: Open the Script Editor
Open your spreadsheet. Go to Extensions > Apps Script. A new browser tab opens with the script editor and a blank file called Code.gs. This is where your code lives. The script is bound to the spreadsheet, so it stays with the file.
Step 3: Write the Report Function
Paste in the function below. It reads a sheet called Sales, adds up today's amounts, and emails the total. Change the sheet name, the columns, and the email address to match your own data.
function sendDailyReport() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sales');
const data = sheet.getRange('A2:D').getValues();
const today = new Date();
let total = 0;
let rows = 0;
data.forEach(function(row) {
if (!row[0]) return;
const rowDate = new Date(row[0]);
if (rowDate.toDateString() === today.toDateString()) {
total += Number(row[3]) || 0;
rows++;
}
});
const subject = 'Daily sales report - ' + today.toDateString();
const body = 'Total sales today: $' + total.toFixed(2) + '\nRows counted: ' + rows;
GmailApp.sendEmail('you@example.com', subject, body);
}
The function assumes column A holds dates and column D holds amounts. If your layout is different, change the column letters and the index numbers. Save the file with the disk icon or Ctrl + S.
Step 4: Run It Once by Hand
Click the Run button in the editor. Google will ask you to approve permissions the first time, because the script reads your sheet and sends email. Review the permissions, then allow them. Check your inbox for the test email. If nothing arrives, open Executions in the left sidebar to see whether the run failed and why.
Step 5: Add a Time-Driven Trigger
In the editor sidebar, click Triggers (the clock icon), then Add Trigger at the bottom right. Choose your function, set the event source to Time-driven, and pick a schedule. A day timer at 8 AM is a good start for a morning report. Click Save. From now on, the report sends itself.
You can also create the same trigger in code, which is handy if you set up the same report on many sheets:
function createDailyTrigger() {
ScriptApp.newTrigger('sendDailyReport')
.timeBased()
.atHour(8)
.everyDays(1)
.create();
}
Run this function once. It creates the trigger, and the trigger then runs your report function every day.
Step 6: Check the First Scheduled Run
Wait for the first automatic run, then confirm two things: the email arrived, and the numbers look right. Compare the emailed total with the sheet. If they differ, check the date column first. Dates stored as text will not match, and the script will count zero rows.
Test, Monitor and Fix Common Problems
Most failures have a small cause. Here are the ones beginners hit most.
- Duplicate triggers. Running the trigger setup function twice creates two triggers, and you get the report twice. Check the Triggers page first. Delete old triggers for a function before you create a new one.
- Wrong sheet name. getSheetByName returns nothing if the name does not match exactly, including spaces. Copy the tab name from the sheet.
- Dates stored as text. A cell that looks like a date may be text. Select the column and set the format to Date before the script reads it.
- Permissions revoked. If you change your Google password or revoke access, triggers stop working. Re-run the function by hand and approve the permissions again.
- Quotas. Installable triggers are subject to Apps Script quota limits. A daily or hourly report is well inside normal use, but a trigger set to every minute can hit limits fast.
The Executions page is your main diagnostic tool. It lists every run, how long it took, and any error message. Read the error before you change the code. It usually names the line that failed.
Keep the Report Useful
Automation only helps if people read the email. A few habits keep your report worth opening.
- Send one number that matters, not a full data dump. Put the total in the first line.
- Send it at a time people act on. A sales total at 8 AM beats one at midnight.
- Send it to the people who need it, and no one else. A report sent to everyone is read by no one.
- Try every change on a copy of the sheet first. A broken script can email the wrong numbers to your whole team.
- Review the trigger every few months. Sheets change, columns move, and a report that once worked can quietly go stale.
Once the daily version works, the same pattern scales. A weekly summary uses the same function with a week timer instead of a day timer. A monthly report reads a different date range. A second function can write the summary back into the sheet instead of emailing it, so the report lives where the team already works.
Bottom line: Apps Script turns a repetitive reporting chore into a short script and a trigger. Build the function, test it by hand, schedule it once, and check the first automatic run. After that, the report takes care of itself.