REDUCE in Apple Numbers
Short answer: REDUCE walks through a range and keeps a running result. Syntax:
REDUCE(initial-value, array, LAMBDA(accumulator, value, calculation))Explanation
REDUCE walks through a range and keeps a running result. The LAMBDA decides how each value is folded into that result.
Syntax
REDUCE(initial-value, array, LAMBDA(accumulator, value, calculation))Example
Add up the squares of the prices (B2:B5) with REDUCE, starting at 0.
| A | B | C | |
|---|---|---|---|
| 1 | Product | Price | Qty |
| 2 | Apple | 4 | 10 |
| 3 | Pear | 6 | 5 |
| 4 | Kiwi | 12 | 2 |
| 5 | Grape | 8 | 3 |
Formula: =REDUCE(0,B2:B5,LAMBDA(acc,v,acc+v*v))
Result: 260
Frequently asked questions
What does REDUCE do in Apple Numbers?
REDUCE walks through a range and keeps a running result. The LAMBDA decides how each value is folded into that result.
What is the syntax of REDUCE?
The syntax is REDUCE(initial-value, array, LAMBDA(accumulator, value, calculation)).
More in this category
Read more
Practise it yourself
Type the formula yourself in a real exercise and see right away if your answer is correct. The first exercises are free.
Start practising