Dynamic arrays
SCAN
All the intermediate totals.
Syntax
SCAN(initial_value, array, LAMBDA(total, x))Example: =SCAN(0,A2:A6,LAMBDA(a,x,a+x))
Available in: Excel 2024, Microsoft 365
Try it
A tiny spreadsheet with example data. Edit the formula or any number and see the result.
Formula in F2: =SCAN(0,C2:C7,LAMBDA(a,x,a+x))
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Region | Product | Units | Price | Result | |
| 2 | East | Pen | 120 | 2.5 | 120 | |
| 3 | West | Pen | 80 | 2.5 | 200 | |
| 4 | East | Book | 45 | 12 | 245 | |
| 5 | North | Book | 60 | 12 | 305 | |
| 6 | West | Lamp | 30 | 25 | 335 | |
| 7 | East | Lamp | 15 | 25 | 350 |
Result in F2: 120