Spreadsheet Practice

REDUCE function

Quick answer

REDUCE walks through every value in an array, passing a running result and the next value to a LAMBDA, and returns the final running result.

Syntax
=REDUCE([initial_value], array, lambda)
Most common use
=REDUCE(0,B2:B5,LAMBDA(total,v,total+v)) returns $1,585 (A plain total: 1,585)

It can total with conditions, count matches or build up text. Think of it as the general form behind SUM, COUNT and MAX: anything that combines a list into one result.

Available in
Excel 2024 and Microsoft 365
Category
Dynamic array functions
Returns
The final running result.
Google Sheets
Available in Google Sheets.

Syntax

=REDUCE([initial_value], array, lambda)

ArgumentRequired?What it is
initial_valueOptionalThe starting value of the running result; 0 if left empty.
arrayRequiredThe values to walk through, row by row.
lambdaRequiredA LAMBDA with two inputs: the running result so far, and the next value.

Examples

Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.

CellFormulaResultWhat it shows
C2=REDUCE(0,B2:B5,LAMBDA(total,v,total+v))$1,585A plain total: 1,585
C3=REDUCE(0,B2:B5,LAMBDA(n,v,IF(v>100,n+1,n)))3Orders over $100: 3
C4=REDUCE(0,B2:B5,LAMBDA(m,v,MAX(m,v)))$910The largest order: 910

Try it live

This is the sample sheet. Change any number or text, or edit a formula, and the results update.

Show the sample data as a table
OrderAmountResult
A-1$120$1,585
A-2$4803
A-3$75$910
A-4$910

Practice REDUCE

Graded instantly, then re-checked on changed data.

Count large orders

In D2, use REDUCE to count how many orders in B2:B9 are over 250.

Common mistakes

What you seeWhy, and how to fix it
#VALUE!The LAMBDA needs exactly two inputs: the running result and the current value.
The result starts wronginitial_value is the starting point. To multiply, start at 1, not 0.

Tips

  • =REDUCE(0,A2:A100,LAMBDA(n,v,n+(LEN(v)>10))) counts long entries without a helper column.

Questions

What does REDUCE do in Excel?

It boils an array down to one result by applying a LAMBDA to a running result and each value in turn.

What is the difference between REDUCE and SCAN?

REDUCE returns only the final result. SCAN returns the running result after every value.

Updated Checked by running: every formula on this page was run by our formula engine on .