Numbers REDUCE: Accumulated Values, Seeds and LAMBDA Examples
Use Numbers REDUCE with explicit initial values, inventory movements, conditional contributions and multiplicative factors checked by full recurrences.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
REDUCE starts with an initial value, processes an array through a LAMBDA calculation and returns the final accumulated value. For example, starting with 40 units and applying movements 12,-7,5,-9,3 ends at 44.
The initial value is part of the calculation. A sum usually starts from zero when there is no opening balance; a product usually starts from one when there is no initial multiplier.
Availability and version history
- Introduced: The original introduction release and date are not established by the checked references. LAMBDA’s separately documented introduction does not establish this helper’s first release.
- Availability: Currently documented in Apple’s Functions Help 15.4 documentation edition; no final supported-version endpoint is established.
- Scope: Shared iWork reference. Function-specific historical Mac, iPad, iPhone and iCloud endpoints are unverified.
- Checked: October 14, 2026, against the official REDUCE reference. Examples were independently calculated; no native Numbers test was performed.
Syntax and the running value
REDUCE(initial-value, array, LAMBDA(accumulator, value, calculation))
Apple’s REDUCE entry lists the initial value, input array and LAMBDA. Inside LAMBDA, accumulator identifies the running value and value identifies the current array element. The calculation is required and must be last.
The published signature does not mark the initial value optional or state an omitted-seed default. Supply it explicitly. LAMBDA(balance,movement,balance+movement) adds each movement to the previous balance; replacing the calculation with multiplication produces a different operation.
A complete inventory-movement worksheet
Create StockReduction, with ten columns A:J and nine rows, including one header row. Put Movement in B1 and enter 12,-7,5,-9,3 in B2:B6. Put 40 in H1 as the opening stock value. Label C1 Manual balance and D1 Prefix total.
In C2 enter =$H$1+B2. In C3 enter =C2+B3 and fill C3 through C6. In D2 enter =$H$1+SUM($B$2:B2) and fill through D6.
| Row | Movement | Expected C and D |
|---|---|---|
| 2 | 12 | 52 |
| 3 | -7 | 45 |
| 4 | 5 | 50 |
| 5 | -9 | 41 |
| 6 | 3 | 44 |
These two controls expose the same arithmetic step by step. They do not silently omit the opening balance or overwrite a movement.
Put labels in F2:F5 and these formulas in G2:G5:
| Cell | Formula | Expected result |
|---|---|---|
| G2 | =REDUCE($H$1,B2:B6,LAMBDA(balance,movement,balance+movement)) |
44 |
| G3 | =$H$1+SUM(B2:B6) |
44 |
| G4 | =G2-C6 |
0 |
| G5 | =REDUCE(0,B2:B6,LAMBDA(balance,movement,balance+movement)) |
4 |
G5 is the net movement, not the closing stock. The difference between G2 and G5 is the opening forty. SUM is simpler when ordinary addition is all you need; REDUCE becomes useful when the running calculation has another rule.
Count selected movements with a different subformula
In G7 enter =REDUCE(0,B2:B6,LAMBDA(total,movement,total+IF(movement>0,1,0))) for 3, counting positive movements. In G8 enter =REDUCE(0,B2:B6,LAMBDA(total,movement,total+IF(movement>0,movement,0))) for 20, their total quantity.
These answers have different units: three records versus twenty units. The negative movements remain in B and still affect the closing balance. A count of positive entries is not the same as their sum.
Advanced: successive multiplicative factors
Create FactorReduction, with eight columns A:H and seven rows, including one header row. Put Factor in A1 and enter 1.2,0.9,1.1 in A2:A4. Put 200 in H1 as the initial amount. In B1 write Recurrence.
Enter =$H$1*A2 in B2, then =B2*A3 in B3 and fill B3 through B4. Expect 240,216,237.6. The middle factor reduces the previous value by 10%; it is not a negative multiplier.
Use D2:D5 for these formulas, with labels in C:
| Cell | Formula | Expected result |
|---|---|---|
| D2 | =REDUCE($H$1,A2:A4,LAMBDA(amount,factor,amount*factor)) |
237.6 |
| D3 | =$H$1*PRODUCT(A2:A4) |
237.6 |
| D4 | =REDUCE(1,A2:A4,LAMBDA(amount,factor,amount*factor)) |
1.188 |
| D5 | =REDUCE(0,A2:A4,LAMBDA(amount,factor,amount*factor)) |
0 |
The zero seed forces every step of this multiplication to zero. An initial value of one instead gives the combined factor. This demonstrates why a seed appropriate for addition is not automatically appropriate for multiplication. PRODUCT directly multiplies the factors when no custom recurrence is needed.
Reconstruct both official examples
On VendorProduct, enter 1,2,3 in A1:A3 with no header in that range. In C1 enter =REDUCE(5,A1:A3,LAMBDA(accumulator,value,accumulator*value)) for 30.
On VendorSquares, enter 1,2,3 in A1:C1 and 4,5,6 in A2:C2, again without a header. In E1 enter =REDUCE(1,A1:C2,LAMBDA(accumulator,value,accumulator+SUMSQ(value))) for 92. The six squares total 91, and the initial one makes 92. In E2 enter =1+SUMSQ(A1:C2) for the same target.
These addition and multiplication examples do not establish every order-sensitive traversal rule for arbitrary multidimensional arrays. For a running history rather than the final value, use SCAN.
Local definitions and practical limits
Apple’s LAMBDA reference says definitions are local to their cell and LAMBDA functions cannot be nested. Each formula here contains one local LAMBDA definition; copying the formula copies it rather than creating a workbook-wide named function.
The examples use explicit numeric inputs. Mixed text, error cells, empty arrays, malformed parameters, array-valued intermediate results and exact runtime errors are outside the checked examples. Preserve the input/output separation and choose a calculation that matches the meaning and units of your data.
English formulas use decimal points and commas. Apple’s functions overview specifies semicolon argument separators when the decimal separator is a comma. These examples do not establish cross-client import or localized error behavior.
LAMBDA defines the running calculation, IF selects a contribution, and SUMSQ provides the squared-value example.