SCAN walks through an array carrying a running result, spilling the value at every step — the cleanest way to make a running total, running max, or cumulative product in a single formula.
0; for each value, add it to the accumulator and output the new total.
The example
One formula produces the whole running-total column.
| A | B | |
|---|---|---|
| 1 | Amount | Running total |
| 2 | 120 | 120 |
| 3 | 80 | 200 |
| 4 | 200 | 400 |
| 5 | 50 | 450 |
The formula
The running total, spilled from one cell:
How it works
SCAN is like REDUCE but keeps every intermediate result:
- The first argument
0is the starting accumulator. - It steps through
A2:A5; theLAMBDA(acc, val, …)takes the running valueaccand the current itemvaland returns the new running value. acc + valmakes a running sum; SCAN spills the accumulator after each step — the whole running-total column.- Swap the operation for a running max (
MAX(acc, val)) or product (acc * val).
SCAN vs REDUCE. Both carry an accumulator through an array. SCAN outputs every step (a running series); REDUCE outputs only the final value (one aggregate).
Try it: interactive demo
Pick an operation; see what SCAN spills across {120, 80, 200, 50}.
Variations
Running maximum
The highest value seen so far:
Cumulative product
Start at 1, multiply:
Running count of matches
Count items meeting a condition as you go:
Pitfalls & errors
SCAN needs Excel 365. The LAMBDA helper functions don’t exist before 365 — use an expanding-range SUM for a running total in older Excel.
Accumulator and value order. The LAMBDA parameters are (accumulator, value) in that order. Swapping them breaks the logic.
Pick the right starting value. 0 for sums, 1 for products, a very small number for a running max — the wrong seed skews the first result.
Practice workbook
Frequently asked questions
How do I make a running total with SCAN in Excel?
What's the difference between SCAN and REDUCE?
How do I make a running maximum or product?
Stop fighting formulas. Learn them in a day.
This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class