Case study: a sales report that updates itself
Case study9 minPremium
Builds on List each value once with UNIQUE, Sort a list with SORT and SORTBY, Pull the matching rows with FILTER and Name the steps of a formula with LET.
At the end of each month, a sales manager in Phoenix sends a one-page report: sales by region, a leaderboard of the reps and the month's big orders. Built from formulas that spill, it rebuilds itself when next month's orders are pasted in, however long the list is.
How it works
Each part of the report is one spilling formula that reads the order list. UNIQUE finds what to report on, the regions or the reps, so nobody types them in. SUMIFS, given that list with #, works out one total per name. SORT and SORTBY put the results in order, and FILTER picks out the rows that pass a test.
Picture the order list as the only place where facts are typed, and the report as questions put to it. Nothing in the report is typed by hand, so it can't fall out of step with the list.
- Keep inputs, such as the size of a big order, in labeled cells.
- Build later formulas on earlier ones with
#, so they grow and shrink together. - Use LET when one result feeds two parts of a formula, such as a list of reps that is both summed and sorted.
Example
A café chain lists each day's takings with the shop in B2:B40 and the amount in C2:C40. Its report ranks the shops by their takings for the month.
=LET(shops,UNIQUE(B2:B40),SORTBY(shops,SUMIFS(C2:C40,B2:B40,shops),-1))The shops come out once each, the busiest first, and a new shop joins the ranking the first day it appears in the list.
Common mistakes
- A SUMIFS that reads
A20:A23where it should readA20#keeps four rows when a fifth region turns up. Read a spill with#. - SORT can only sort by a column of the list it sorts. To rank names by totals worked out elsewhere, use SORTBY.
- A formula placed in the path of a spill blocks it with
#SPILL!once the list grows. Leave empty rows below every list, or put the lists side by side. - A region name typed into the report goes stale when the regions change. Let UNIQUE find the names.
In short
- UNIQUE finds what to report on, SUMIFS with
#totals each name, and SORT, SORTBY and FILTER shape the lists. - Every part reads the order list, so pasting in next month's orders updates the whole report.
- Inputs go in labeled cells, and later formulas read earlier spills with
#.
Practice
Premium4 formulas.
Practice is part of Premium
Every lesson is free to read, and you can practice the free lessons without an account. This lesson's exercises are part of Premium, which you add to a free account.
Have one? Sign in