Blog · Google Sheets

Automate Google Sheets: the weekly report that builds itself

Three regions send their sales figures, someone copies them together, checks targets by eye and chases missing stores. Every week. This guide shows how to build that report once with smart formulas, a recorded macro and AI as your formula helper. No Apps Script, no add-ons.

1
StackAll regions in one master table
2
EnrichTargets and % added automatically
3
SummarisePick a week, the report updates
4
Check & alertMissing stores and big changes flagged
5
Macro + AIOne shortcut, one prompt template
At a glance
  • VSTACK + FILTER combine several tabs into one master table, and new rows flow in on their own.
  • XLOOKUP, BYROW and QUERY add targets and build a summary that follows a drop-down.
  • LET + MAP compare this week with last week and flag missing or unusual figures.
  • A recorded macro handles the formatting, AI writes and explains new formulas for you.

The use case: one weekly sales report, three regions

A field sales team has nine stores in three regions. Each region keeps its own tab. Head office keeps the store list with weekly targets. The aim: a report that shows revenue against target, names the stores that did not report and flags anything that moved more than 15 %.

Before: by hand

  • Copy three tabs into one, week after week
  • Fix typos and stray spaces in store names
  • Look up each target and work out the %
  • Spot missing stores by scrolling

After: built once

  • New rows appear in the master table on their own
  • Names are cleaned while they are stacked
  • Choose a week in a drop-down, the summary follows
  • Missing and unusual stores are flagged, an email can follow

Practice data to copy

Open a blank spreadsheet and create four tabs: North, South, West and Targets. Click “Copy data”, click cell A1 of the matching tab and press Ctrl+V. Then add three empty tabs: Master, Report and Check.

The data contains two mistakes on purpose: “munich ” with a trailing space and “ Frankfurt” with a leading space. Bremen has no figures for week 49.

Northpaste into A1 of tab North
WeekRegionStoreUnitsRevenue
48NorthHamburg4128240
48NorthKiel1983960
48NorthBremen2655300
49NorthHamburg4368720
49NorthKiel1513020
Southpaste into A1 of tab South
WeekRegionStoreUnitsRevenue
48SouthMunich3887760
48SouthStuttgart2404800
48SouthNuremberg2054100
49Southmunich 4018020
49SouthStuttgart2625240
49SouthNuremberg1993980
Westpaste into A1 of tab West
WeekRegionStoreUnitsRevenue
48WestCologne3016020
48WestBonn2765520
48WestFrankfurt3507000
49WestCologne3306600
49WestBonn2805600
49West Frankfurt2685360
Targetspaste into A1 of tab Targets
StoreRegionWeekly target
HamburgNorth8000
KielNorth4000
BremenNorth5000
MunichSouth7500
StuttgartSouth5000
NurembergSouth4000
CologneWest6500
BonnWest5500
FrankfurtWest7200
Step 1

Consolidate all regions into one master table

In tab Master, type the headers in row 1: Week, Region, Store, Units, Revenue, Target, vs target. Then one formula in A2 does the rest. It has three parts:

1 · Stack everything
all = VSTACK(…)

Puts the three tabs on top of each other: North, South, West.

Open ranges like A2:E include every future row.

2 · Drop empty rows
rows = FILTER(…)

Keeps only rows with a week in column 1.

Open ranges also bring hundreds of empty rows.

3 · Clean the names
HSTACK(… PROPER(TRIM(…)))

Removes spaces and fixes capitals in the store column.

“munich ” becomes “Munich”.

  1. Start simple. Click Master!A2 and enter =VSTACK(North!A2:E,South!A2:E,West!A2:E)All rows appear, followed by a long tail of empty rows. That tail is why step 2 exists.
  2. Replace it with the full formula below. LET gives each part a name, so you can read it like a recipe: all, then rows, then the cleaned result.
  3. Press Enter. Master now shows 17 rows, with “Munich” and “Frankfurt” spelled cleanly.
  4. Test the automation: add the row 49 | North | Bremen | 240 | 4800 at the bottom of tab North. It appears in Master instantly. Delete it again for the next steps.
Data in separate files? Swap each tab for IMPORTRANGE. The first time, click the cell and confirm “Allow access”.
Step 2

Cross-reference: add the target to every row

The master table knows the revenue, the Targets tab knows the target. XLOOKUP connects them, and ARRAYFORMULA lets one formula fill the whole column, including rows that arrive next week.

  1. Click Master!F2 and enter the target formula. Each store gets its weekly target. A store missing from the list shows “No target”.
  2. Click Master!G2 and enter the % formula. Then format column G as a percentage: Format › Number › Percent.
  3. Check the result: Kiel and Frankfurt sit around 75 % in week 49, everyone else close to or above 100 %.

Why IF(C2:C="","",…)? It keeps the formula quiet in empty rows, so the column does not fill up with errors.

Step 3

The dynamic report: pick a week, everything updates

In tab Report, B1 holds the week. Everything else reads from it.

  1. Build the drop-down: type “Week” in A1, click B1, choose Insert › Dropdown and add the options 48 and 49. Select 49.
  2. Total and % vs target: type “Total revenue” in D1 and “vs target” in D2, then enter the two formulas in E1 and E2.E2 divides by the full target list on purpose. If a store does not report, the gap shows up instead of hiding.
  3. Summary by region: click A3 and enter the QUERY formula. It writes a small table: region and revenue for the selected week.The &B1& part glues the drop-down value into the query, so the table follows your choice.
  4. Target per region: type “Target” in C3 and “vs target” in D3. In C4, BYROW runs a small LAMBDA once per region and sums its targets. D4 divides revenue by target.
  5. Stores below target: type “Below target this week” in G1 and enter the last formula in G2. IFNA shows a friendly message when no store is below target.
  6. Test it: switch B1 to 48 and back to 49. Every number moves with it.

Your result for week 49:

RegionRevenueTargetvs target
North€11,740€17,00069%
South€17,240€16,500104%
West€17,560€19,20091%

Total revenue: €46,540, 88 % of target. North looks weak because Bremen has not reported yet. Step 4 makes that visible.

Step 4

Compare datasets: flag missing stores and big changes

Tab Check compares two sources: the store list from head office and the reports that actually came in. It also sets this week against last week.

  1. Link the week: type “Week” in A1 and =Report!B1 in B1. Check now follows the same drop-down.
  2. Who did not report? Type “No report this week” in A2 and enter the first formula in A3. COUNTIFS counts each store’s rows for the week. Zero rows means missing. Result: Bremen.
  3. This week against last week: type the headers Store, Last week, This week, Change, Status in A6:E6. Enter the comparison formula in A7.LET names each column, MAP calculates it store by store, HSTACK puts the five columns side by side. Status says Missing, New, Check (±15 % or more) or OK.
  4. Colour the flags: select A7:E30, choose Format › Conditional formatting › Custom formula is, enter =$E7="Missing" with a red fill. Add a second rule with =$E7="Check" in yellow.
  5. One alert cell: type “Alert” in D1 and enter the alert formula in E1. Week 49 reads “1 missing, 2 to check”.

Your result for week 49:

StoreLast weekThis weekChangeStatus
Hamburg€8,240€8,720+6%OK
Kiel€3,960€3,020-24%Check
Bremen€5,300€0Missing
Munich€7,760€8,020+3%OK
Stuttgart€4,800€5,240+9%OK
Nuremberg€4,100€3,980-3%OK
Cologne€6,020€6,600+10%OK
Bonn€5,520€5,600+1%OK
Frankfurt€7,000€5,360-23%Check

Munich only matches because step 1 cleaned “munich ”. Without TRIM, Munich would show up as missing. Week 48 shows “New” for every store, because there is no week 47 in the data.

Automatic notifications, without code

  • Any change: Tools › Notification settings › Edit notifications. Choose “Any changes are made” and “Email – right away” or a daily digest.
  • Rule-based: Tools › Conditional notifications › Add rule, for example “column Status changes to Missing”, plus the email addresses to inform. Google offers this for certain work and school accounts. If you do not see the menu item, ask your admin.
Step 5

Record a macro and let AI write the next formula

A macro for the recurring clean-up

Formulas calculate. A macro repeats clicks: formatting, sorting, freezing the header. You record it once, no coding.

  1. Start recording: Extensions › Macros › Record macro. Choose Use absolute references if the macro should always work on the same cells, or Use relative references if it should start wherever your cursor is.
  2. Do the clicks once: for example in tab Master, make row 1 bold, freeze it (View › Freeze › 1 row), format E:F as currency and G as percent.
  3. Save: give it a name like “Format master” and a shortcut number. From then on Ctrl+Alt+Shift+1 runs it (Mac: ⌘+Option+Shift+1).
  4. First run: Google asks once for permission. That is normal, because the recording is stored as a small script in the background.

AI as your formula helper

ChatGPT or Claude write formulas like the ones above in seconds, if you describe your sheet precisely. This template works well. Fill in the brackets:

  • Test before you trust: paste the formula into a copy of the sheet and check two rows by hand.
  • Ask for the weak spot: “When would this formula break?” often reveals blank rows or spaces.
  • Iterate: “Rewrite it with LET so it is easier to read” or “Make it work for open ranges”.

Two extras for advanced users

Your own function with a name

Data › Named functions › Add new function. Name it ATTAINMENT, add the placeholders actual and target and use the definition below without the LAMBDA wrapper: IFERROR(actual/target,""). Then anyone in the file can write =ATTAINMENT(E2,F2). Try the logic first as a LAMBDA:

QUERY instead of FILTER

Prefer one readable line? QUERY can also stack and filter in one go. Col1 stands for the first column of the stacked data.

If it does not work

  • #REF! “Array result was not expanded” – something is in the way of the result. Clear the cells below or right of the formula.
  • #N/A from FILTER – nothing matches. Wrap the formula in IFNA with a friendly message, as in steps 3 and 4.
  • A store shows as missing although it reported – a space or typo in its name. TRIM and PROPER in step 1 fix that at the source.
  • Formula parse error – your locale expects semicolons. Check File › Settings › Locale, or replace each comma with a semicolon.

Your turn: automate one report this week

Pick the report you build by hand most often and go through this checklist:

  • Where does the data come from, and is each source in one tab or file with the same columns?
  • Which formula stacks it: VSTACK for tabs, IMPORTRANGE for files?
  • Which value do you look up from a second list, such as targets or prices?
  • Which cell should control the report: week, region or product?
  • What counts as “unusual”, and who needs an email when it happens?
  • Which clicks do you repeat every time? Record them as a macro.

Automate the reports your team builds by hand

This exercise comes from our Google Sheets automation training. Your team works on its own reports, from consolidation to alerts, in the advanced Google Sheets training, on site or live online. For a kick-off or team event, book a talk on smarter work with data and AI.

About the author: Joern Steinz

Joern Steinz is a trainer and the founder of SkillDay. Since 2014 he has facilitated more than 1.000 workshops and trainings, for clients including Allianz, DHL, Lufthansa and Siemens. In his Excel and Google Sheets trainings, teams work with real data and leave with templates they use right away.

More Google Sheets guides: XLOOKUP in Google Sheets, chart data range · Trainings: Google Sheets training, Google Sheets dashboard training

Automate Google Sheets: frequently asked questions

Can I automate Google Sheets without Apps Script?
Yes. Formulas such as VSTACK, FILTER, XLOOKUP, QUERY, BYROW and MAP update on their own when data changes. Macros repeat clicks, and notifications send emails. Apps Script is only needed for things like scheduled exports or custom emails.
How do I combine data from several spreadsheets?
Within one file, VSTACK stacks tabs. For separate files, wrap each source in IMPORTRANGE and stack the results with VSTACK. Each file asks once for access.
Can Google Sheets send me an email when something changes?
Yes. Tools › Notification settings sends emails for any change. With certain work and school accounts, Tools › Conditional notifications sends emails when a range changes or meets a condition, for example a status turning to Missing.
Comma or semicolon in formulas?
That depends on the spreadsheet locale under File › Settings. With the United Kingdom or United States, commas separate the parts. Many other European locales use semicolons.
Are recorded macros shared with my colleagues?
Macros belong to the spreadsheet. Anyone with edit access can run them from Extensions › Macros. Each person confirms the permission request once.

Google Sheets is a trademark of Google LLC. ChatGPT is a trademark of OpenAI; Claude is a trademark of Anthropic. SkillDay is an independent training provider. The practice data is fictitious.