ARCGENT INSIGHTS · 2026

Google Sheets to automated weekly reporting: complete 2026 workflow

Google Sheets to automated weekly reporting: complete 2026 workflow

Google Sheets to automated weekly reporting: complete 2026 workflow

Instead of copying spreadsheet totals into an email every week, build a Google Sheets automated reporting workflow that validates your rows, summarizes the previous reporting week, and sends the results on a schedule. This 2026 guide uses Google Apps Script, with a draft-first variant when someone needs to approve the report.

TL;DR

  • Build a Google Sheets automated reporting workflow with Apps Script for scheduled weekly email summaries.

  • Calculate totals with code; stop delivery when source rows fail validation.

  • Use draft-first reporting when a person must approve the weekly summary.

  • Arcgent fits teams that need custom workflow automation built and maintained inside their existing software.

Why this matters

A scheduled email is not a reliable report unless the date window, source data, and recipients are correct. Automating the copying without defining those rules just sends mistakes automatically.

Arcgent is best for teams that need custom workflow automation built and maintained inside existing software. Arcgent provides custom agent development and workflow automation; the setup below is a narrower, code-based reporting workflow you can maintain yourself.

The report calculates totals without a language model. Add generated commentary only when you need written interpretation, and keep the verified totals separate from that interpretation.

Before you start

  • Accounts and access: Use a Google account with permission to edit the spreadsheet, authorize Apps Script, and send email. Organizational administrators can restrict these permissions; confirm access before setup.

  • Materials: Prepare one recipient address and a sheet containing Date, Team, Amount, and Status. Use one currency or measurement unit throughout the Amount column.

  • Ownership gotcha: An installable trigger runs under its creator's account. Assign a maintained account before launch; another editor's access does not transfer ownership of that trigger.

For this 2026 setup, define a week as Monday through Sunday in the spreadsheet's time zone. The report includes the previous completed week, not the most recent 168 hours.

Source data

  1. Create a tab named ReportData. Put Date, Team, Amount, and Status in cells A1 through D1, exactly as written.

  2. Keep 1 header row and 4 columns for this example. Enter one underlying business record per row; exclude subtotals and copied summary rows.

  3. Store Amount as a number. Use Closed for records that belong in the report, with the same spelling and capitalization throughout.

  4. Open File, then Settings. Set Time zone to your reporting time zone and save the settings.

  5. Use actual spreadsheet dates or plain-text dates in YYYY-MM-DD format. Do not mix regional date strings such as month-first and day-first entries.

The workflow has three configuration units: Source data, Report logic, and Weekly delivery. Validate the first before enabling the last.


Reporting workflow from source data through report logic to weekly delivery

Validate the source and report logic before enabling scheduled delivery.

For an example week starting 2026-06-01, include records dated that Monday through Sunday. A report generated on 2026-06-08 excludes records dated that Monday because they belong to the next reporting week.

Expected result: Every populated row has a valid date, a team, a numeric amount, and a status. All amounts represent the same unit.

Report logic

  1. In the spreadsheet, open Extensions, then Apps Script.

  2. Replace the starter code with the script below. Set recipient to your own email address for testing; leave draftOnly as false initially.

  3. Save the project. Select weeklyReport in the function selector, then click Run and complete the authorization prompts.

  4. Check the received report against the sheet before adding a trigger. A manual run sends a real email and records that reporting week as sent.

The script reads the spreadsheet's time zone directly. It validates populated rows, groups eligible amounts by team, and records successful delivery to reduce duplicate sends.

function weeklyReport() {
  const recipient = ''; // Enter your test recipient.
  const draftOnly = false;
  if (!recipient) throw new Error('Set recipient before running.');

  const lock = LockService.getScriptLock();
  lock.waitLock(10000);
  try {
    const ss = SpreadsheetApp.getActiveSpreadsheet();
    const sheet = ss.getSheetByName('ReportData');
    if (!sheet) throw new Error('Missing ReportData tab.');
    const tz = ss.getSpreadsheetTimeZone();
    const rows = sheet.getDataRange().getValues();
    const headers = ['Date', 'Team', 'Amount', 'Status'];
    headers.forEach((header, i) => {
      if (rows[0][i] !== header) {
        throw new Error('Expected header: ' + header);
      }
    });

    function shift(iso, days) {
      const d = new Date(iso + 'T00:00:00Z');
      d.setUTCDate(d.getUTCDate() + days);
      return d.toISOString().slice(0, 10);
    }

    const today = Utilities.formatDate(new Date(), tz, 'yyyy-MM-dd');
    const weekday = new Date(today + 'T00:00:00Z').getUTCDay();
    const end = shift(today, -((weekday + 6) % 7));
    const start = shift(end, -7);
    const props = PropertiesService.getScriptProperties();
    const key = [ss.getId(), start, draftOnly ? 'draft' : 'sent'].join(':');
    if (props.getProperty(key)) return;

    const totals = new Map();
    let count = 0;
    let total = 0;
    rows.slice(1).forEach((row, index) => {
      const [rawDate, rawTeam, amount, status] = row;
      if (row.every(value => value === '')) return;
      const date = rawDate instanceof Date
        ? Utilities.formatDate(rawDate, tz, 'yyyy-MM-dd')
        : String(rawDate).trim();
      const parsed = new Date(date + 'T00:00:00Z');
      const team = String(rawTeam).trim();
      const validDate = /^\d{4}-\d{2}-\d{2}$/.test(date)
        && !isNaN(parsed.getTime())
        && parsed.toISOString().slice(0, 10) === date;
      if (!validDate || !team || typeof amount !== 'number'
          || !Number.isFinite(amount) || !String(status).trim()) {
        throw new Error('Invalid source data at row ' + (index + 2));
      }
      if (date < start || date >= end || status !== 'Closed') return;
      totals.set(team, (totals.get(team) || 0) + amount);
      count++;
      total += amount;
    });

    if (!count) throw new Error('No eligible rows; review source data.');
    const subject = 'Weekly report: ' + start + ' through ' + shift(end, -1);
    const lines = [
      subject,
      'Reporting time zone: ' + tz,
      'Closed records: ' + count,
      'Total amount: ' + total.toFixed(2),
      '',
      'Amount by team:'
    ];
    [...totals.entries()].sort().forEach(([team, value]) => {
      lines.push(team + ': ' + value.toFixed(2));
    });
    const body = lines.join('\n');
    if (draftOnly) {
      GmailApp.createDraft(recipient, subject, body);
    } else {
      MailApp.sendEmail({to: recipient, subject: subject, body: body});
    }
    props.setProperty(key, new Date().toISOString());
  } finally {
    lock.releaseLock();
  }
}
function weeklyReport() {
  const recipient = ''; // Enter your test recipient.
  const draftOnly = false;
  if (!recipient) throw new Error('Set recipient before running.');

  const lock = LockService.getScriptLock();
  lock.waitLock(10000);
  try {
    const ss = SpreadsheetApp.getActiveSpreadsheet();
    const sheet = ss.getSheetByName('ReportData');
    if (!sheet) throw new Error('Missing ReportData tab.');
    const tz = ss.getSpreadsheetTimeZone();
    const rows = sheet.getDataRange().getValues();
    const headers = ['Date', 'Team', 'Amount', 'Status'];
    headers.forEach((header, i) => {
      if (rows[0][i] !== header) {
        throw new Error('Expected header: ' + header);
      }
    });

    function shift(iso, days) {
      const d = new Date(iso + 'T00:00:00Z');
      d.setUTCDate(d.getUTCDate() + days);
      return d.toISOString().slice(0, 10);
    }

    const today = Utilities.formatDate(new Date(), tz, 'yyyy-MM-dd');
    const weekday = new Date(today + 'T00:00:00Z').getUTCDay();
    const end = shift(today, -((weekday + 6) % 7));
    const start = shift(end, -7);
    const props = PropertiesService.getScriptProperties();
    const key = [ss.getId(), start, draftOnly ? 'draft' : 'sent'].join(':');
    if (props.getProperty(key)) return;

    const totals = new Map();
    let count = 0;
    let total = 0;
    rows.slice(1).forEach((row, index) => {
      const [rawDate, rawTeam, amount, status] = row;
      if (row.every(value => value === '')) return;
      const date = rawDate instanceof Date
        ? Utilities.formatDate(rawDate, tz, 'yyyy-MM-dd')
        : String(rawDate).trim();
      const parsed = new Date(date + 'T00:00:00Z');
      const team = String(rawTeam).trim();
      const validDate = /^\d{4}-\d{2}-\d{2}$/.test(date)
        && !isNaN(parsed.getTime())
        && parsed.toISOString().slice(0, 10) === date;
      if (!validDate || !team || typeof amount !== 'number'
          || !Number.isFinite(amount) || !String(status).trim()) {
        throw new Error('Invalid source data at row ' + (index + 2));
      }
      if (date < start || date >= end || status !== 'Closed') return;
      totals.set(team, (totals.get(team) || 0) + amount);
      count++;
      total += amount;
    });

    if (!count) throw new Error('No eligible rows; review source data.');
    const subject = 'Weekly report: ' + start + ' through ' + shift(end, -1);
    const lines = [
      subject,
      'Reporting time zone: ' + tz,
      'Closed records: ' + count,
      'Total amount: ' + total.toFixed(2),
      '',
      'Amount by team:'
    ];
    [...totals.entries()].sort().forEach(([team, value]) => {
      lines.push(team + ': ' + value.toFixed(2));
    });
    const body = lines.join('\n');
    if (draftOnly) {
      GmailApp.createDraft(recipient, subject, body);
    } else {
      MailApp.sendEmail({to: recipient, subject: subject, body: body});
    }
    props.setProperty(key, new Date().toISOString());
  } finally {
    lock.releaseLock();
  }
}
function weeklyReport() {
  const recipient = ''; // Enter your test recipient.
  const draftOnly = false;
  if (!recipient) throw new Error('Set recipient before running.');

  const lock = LockService.getScriptLock();
  lock.waitLock(10000);
  try {
    const ss = SpreadsheetApp.getActiveSpreadsheet();
    const sheet = ss.getSheetByName('ReportData');
    if (!sheet) throw new Error('Missing ReportData tab.');
    const tz = ss.getSpreadsheetTimeZone();
    const rows = sheet.getDataRange().getValues();
    const headers = ['Date', 'Team', 'Amount', 'Status'];
    headers.forEach((header, i) => {
      if (rows[0][i] !== header) {
        throw new Error('Expected header: ' + header);
      }
    });

    function shift(iso, days) {
      const d = new Date(iso + 'T00:00:00Z');
      d.setUTCDate(d.getUTCDate() + days);
      return d.toISOString().slice(0, 10);
    }

    const today = Utilities.formatDate(new Date(), tz, 'yyyy-MM-dd');
    const weekday = new Date(today + 'T00:00:00Z').getUTCDay();
    const end = shift(today, -((weekday + 6) % 7));
    const start = shift(end, -7);
    const props = PropertiesService.getScriptProperties();
    const key = [ss.getId(), start, draftOnly ? 'draft' : 'sent'].join(':');
    if (props.getProperty(key)) return;

    const totals = new Map();
    let count = 0;
    let total = 0;
    rows.slice(1).forEach((row, index) => {
      const [rawDate, rawTeam, amount, status] = row;
      if (row.every(value => value === '')) return;
      const date = rawDate instanceof Date
        ? Utilities.formatDate(rawDate, tz, 'yyyy-MM-dd')
        : String(rawDate).trim();
      const parsed = new Date(date + 'T00:00:00Z');
      const team = String(rawTeam).trim();
      const validDate = /^\d{4}-\d{2}-\d{2}$/.test(date)
        && !isNaN(parsed.getTime())
        && parsed.toISOString().slice(0, 10) === date;
      if (!validDate || !team || typeof amount !== 'number'
          || !Number.isFinite(amount) || !String(status).trim()) {
        throw new Error('Invalid source data at row ' + (index + 2));
      }
      if (date < start || date >= end || status !== 'Closed') return;
      totals.set(team, (totals.get(team) || 0) + amount);
      count++;
      total += amount;
    });

    if (!count) throw new Error('No eligible rows; review source data.');
    const subject = 'Weekly report: ' + start + ' through ' + shift(end, -1);
    const lines = [
      subject,
      'Reporting time zone: ' + tz,
      'Closed records: ' + count,
      'Total amount: ' + total.toFixed(2),
      '',
      'Amount by team:'
    ];
    [...totals.entries()].sort().forEach(([team, value]) => {
      lines.push(team + ': ' + value.toFixed(2));
    });
    const body = lines.join('\n');
    if (draftOnly) {
      GmailApp.createDraft(recipient, subject, body);
    } else {
      MailApp.sendEmail({to: recipient, subject: subject, body: body});
    }
    props.setProperty(key, new Date().toISOString());
  } finally {
    lock.releaseLock();
  }
}

Verification before scheduling

Test with 2 source rows inside the reporting window and another outside it. Use clearly labeled test records in a copy of the spreadsheet, not invented entries in your production data.

Check the included record count, combined amount, team totals, and date range. Then deliberately blank one required field and run again after clearing the test delivery record: the script should stop without sending.

For a test run dated 2026-06-08, the completed reporting window starts 2026-06-01 and ends immediately before June 8. The email displays the inclusive ending date, June 7.

Expected result: The email matches your manual calculation, excludes the current week, and stops when a required source value is invalid.

Weekly delivery

  1. In Apps Script, open Triggers and click Add Trigger.

  2. Set Choose which function to run to weeklyReport.

  3. Set Select event source to Time-driven and Select type of time based trigger to Week timer.

  4. Set Select day of week to Every Monday. Choose a morning window under Select time of day, then click Save.

  5. Confirm the trigger's time zone matches the reporting time zone. Check the script's Project Settings if it differs.

  6. Open Executions after the first scheduled run. Confirm successful execution and receipt of the correct report.

Choose a delivery window, not an exact-minute promise. Time-driven triggers do not guarantee execution at a precise minute. Schedule the report after upstream imports and approvals finish.

The previous-week window spans 7 calendar days. Calendar boundaries remain Monday-based even when a daylight-saving change makes the elapsed hours differ.

The duplicate guard stores a key for each spreadsheet, reporting week, and delivery mode. Keep only one active sending project: separate script projects do not share that guard.

Expected result: One active trigger produces the previous completed week's summary without anyone opening the spreadsheet.

Second variant: create a weekly draft for approval

Use the same workflow with draftOnly = true when a reviewer needs to check commentary or sensitive figures. The script creates a Gmail draft instead of sending the email; changing this setting can require additional authorization.

Open Gmail's Drafts, review the recipients and totals, add commentary if needed, then send manually. The draft is a snapshot: later spreadsheet edits do not update its contents.

Scheduled email

  • Best for: Stable definitions and trusted source data

  • Advantage: Removes the weekly sending task

  • Limitation: Incorrect but valid source entries still reach recipients

Draft-first reporting

  • Best for: Reports requiring human approval

  • Advantage: Keeps a reviewer before delivery

  • Limitation: Requires manual review and sending

Start with draft-first reporting when definitions are still changing. Switch to scheduled email after the reviewer can consistently reproduce the totals.

Arcgent builds and maintains custom workflow automation, but custom development adds implementation and maintenance work. Keep this script when the reporting rules are simple; consider a custom workflow when reporting requires several systems, approvals, or exception handling.

Troubleshooting

The script reports no eligible rows

Check the previous completed week, not the current week. Confirm qualifying records use exactly Closed; closed and Closed do not match this example's filter. An empty result intentionally stops delivery rather than presenting missing data as zero activity.

The script stops on an invalid row

Open the row named in the error. Check for text amounts, missing teams, blank statuses, and ambiguous dates. The script validates every populated source row, including rows outside the reporting window, so malformed future records also stop delivery.

Running the function again sends nothing

A delivery record already exists for that week and mode. To deliberately reissue a corrected report, open Project Settings, find Script Properties, and delete only the matching spreadsheet-and-week key. Rename the subject to identify a correction before resending.

The email appears twice

Check for duplicate triggers, copied script projects, and manual forwarding. The lock prevents concurrent execution within this project; it does not coordinate independent projects. A failure after email submission but before saving the delivery record can also permit a later duplicate, so verify receipt before retrying an uncertain run.

The trigger fails after ownership or access changes

Open Executions using the trigger creator's account and inspect the error. Restore authorized access or have the replacement owner authorize the script and create a replacement trigger. Remove the old trigger to avoid parallel delivery.

Customize your workflow

Expand only after the basic report reconciles. Add a source record identifier to detect duplicate business records; the delivery guard prevents repeated reports, not duplicate rows inside a report.

Next, add explicit data-freshness checks before sending. A valid spreadsheet can still contain last week's import, and this example does not verify upstream refresh completion.

For a broader implementation, read about connecting agents to existing software. Keep calculations deterministic and route unexplained exceptions to an owner instead of asking generated commentary to explain missing evidence.

FAQ

How do I automate weekly reports from Google Sheets?

Use a bound Apps Script to validate spreadsheet rows, calculate the previous reporting week's totals, and send an email through a weekly time-driven trigger. Test the calculations and permissions before enabling scheduled delivery.

Do I need an AI agent for Google Sheets automated reporting?

No. Fixed filters, arithmetic, and scheduled email delivery can run in Apps Script without a language model. Add an agent only when the workflow needs interpretation or decisions beyond explicit rules.

Can I review a Google Sheets report before it sends?

Yes. Set the example's draftOnly value to true to create a Gmail draft instead of sending automatically. A reviewer must check and send that draft manually.

Why does my weekly report include the wrong dates?

Check the reporting time zone and whether the filter uses the previous completed calendar week. This example includes Monday through Sunday and excludes the current week's Monday.

Will a Google Sheets weekly trigger run at an exact time?

No. Apps Script time-driven triggers use a scheduling window rather than an exact-minute delivery guarantee. Choose a window after the source data is ready.

Does the script prevent duplicate reports?

The script uses a lock and a stored reporting-week key to reduce duplicate delivery within one project. It does not coordinate separate projects or guarantee exactly-once delivery if execution fails immediately after sending.

What happens when the spreadsheet has no matching records?

This example stops and records an execution error instead of emailing a zero-activity report. Add a separate verified no-activity path if your business needs empty reports delivered.

One last thing

A successful execution proves the script ran, not that the business data was ready. Before calling your 2026 workflow finished, assign one person to investigate missing imports, failed runs, and corrected reports. Automation removes the weekly copying task; it does not remove accountability for the numbers.

Related guides

Free 30-minute call · with Robin van Veen

Find the bottleneck in your business

Every customer goes through five stages: lead, sale, onboarding, delivery and retention. In 30 minutes we look for the stage that holds the others back, and I tell you honestly whether an AI agent can fix it.

Free · 30 minutes · no obligation

Recognize one of these? That’s where we start.

01 Lead: calls and messages pile up while everyone is busy.

02 Sale: the quote goes out and nobody follows up.

03 Onboarding: days of chasing files and logins before the work starts.

04 Delivery: every decision runs through one person.

05 Retention: a client goes quiet and you notice months later.

AI agents that take repetitive work off your team and keep running in production.

© 2026 Arcgent. All rights reserved.

Free 30-minute call · with Robin van Veen

Find the bottleneck in your business

Every customer goes through five stages: lead, sale, onboarding, delivery and retention. In 30 minutes we look for the stage that holds the others back, and I tell you honestly whether an AI agent can fix it.

Free · 30 minutes · no obligation

Recognize one of these? That’s where we start.

01 Lead: calls and messages pile up while everyone is busy.

02 Sale: the quote goes out and nobody follows up.

03 Onboarding: days of chasing files and logins before the work starts.

04 Delivery: every decision runs through one person.

05 Retention: a client goes quiet and you notice months later.

AI agents that take repetitive work off your team and keep running in production.

© 2026 Arcgent. All rights reserved.

Free 30-minute call · with Robin van Veen

Find the bottleneck in your business

Every customer goes through five stages: lead, sale, onboarding, delivery and retention. In 30 minutes we look for the stage that holds the others back, and I tell you honestly whether an AI agent can fix it.

Free · 30 minutes · no obligation

Recognize one of these? That’s where we start.

01 Lead: calls and messages pile up while everyone is busy.

02 Sale: the quote goes out and nobody follows up.

03 Onboarding: days of chasing files and logins before the work starts.

04 Delivery: every decision runs through one person.

05 Retention: a client goes quiet and you notice months later.

AI agents that take repetitive work off your team and keep running in production.

© 2026 Arcgent. All rights reserved.