REDUCE function

REDUCE iteratively applies a LAMBDA to each element of an array, carrying forward an accumulator that starts with the initial value.

=REDUCE(initial_value, array, lambda)

Generate a REDUCE formula

Describe what you need. The generator will reach for REDUCE where REDUCE is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How REDUCE reads its arguments
initial_valuerequiredarrayrequiredlambdarequiredREDUCE
ArgumentRequiredDescription
initial_valueRequiredAny scalar or array that serves as the accumulator's starting point; if the array argument is empty, REDUCE simply returns this value.
arrayRequiredA range or array that supplies the sequence of values REDUCE will feed to the LAMBDA; a single-column or single-row array works, and empty arrays trigger the edge case described above.
lambdaRequiredA LAMBDA with exactly two parameters (accumulator, current) that returns the updated accumulator; mismatched parameter counts cause a #VALUE! error.

Returns

Returns a single value whose type matches the accumulator produced by the LAMBDA.

Availability

Excel: 365 · Google Sheets: Supported

Worked examples

1. Total hours logged

TaskOwnerStartDueHours
DesignAlice2024-01-012024-01-058
DevelopBob2024-01-032024-01-1015
TestAlice2024-01-062024-01-125
=REDUCE(0, INDEX({"Task","Owner","Start","Due","Hours";"Design","Alice","2024-01-01","2024-01-05",8;"Develop","Bob","2024-01-03","2024-01-10",15;"Test","Alice","2024-01-06","2024-01-12",5}, ,5), LAMBDA(acc,val, acc+val))

Result: 28

The INDEX call extracts the fifth column (Hours) as the array {8;15;5}. REDUCE starts with 0, then adds each hour value to the accumulator, yielding 0+8=8, 8+15=23, 23+5=28. The final result is the total hours across all tasks.

2. Latest due date

TaskOwnerStartDueHours
DesignAlice2024-01-012024-01-058
DevelopBob2024-01-032024-01-1015
TestAlice2024-01-062024-01-125
=REDUCE(DATE(1900,1,1), INDEX({"Task","Owner","Start","Due","Hours";"Design","Alice","2024-01-01","2024-01-05",8;"Develop","Bob","2024-01-03","2024-01-10",15;"Test","Alice","2024-01-06","2024-01-12",5}, ,4), LAMBDA(acc,val, IF(val>acc, val, acc)))

Result: 2024-01-12

The fourth column (Due) supplies the dates {2024-01-05;2024-01-10;2024-01-12}. REDUCE begins with a very early sentinel date and keeps the larger of the accumulator and each new date. After processing all rows, the accumulator holds the latest due date, 12 January 2024.

3. List unique owners

TaskOwnerStartDueHours
DesignAlice2024-01-012024-01-058
DevelopBob2024-01-032024-01-1015
TestAlice2024-01-062024-01-125
=REDUCE("", INDEX({"Task","Owner","Start","Due","Hours";"Design","Alice","2024-01-01","2024-01-05",8;"Develop","Bob","2024-01-03","2024-01-10",15;"Test","Alice","2024-01-06","2024-01-12",5}, ,2), LAMBDA(acc,val, IF(ISNUMBER(SEARCH(val,acc)), acc, IF(acc="", val, acc&", "&val))))

Result: Alice, Bob

The second column (Owner) yields {"Alice";"Bob";"Alice"}. REDUCE starts with an empty string. For each owner, the LAMBDA checks whether the name already appears in the accumulator using SEARCH; if not, it appends the name (adding a comma when needed). The final string contains each distinct owner exactly once.

Common errors

Which REDUCE error are you seeing?
REDUCE returned an error#VALUE!
Rewrite the LAMBDA to accept two arguments, e.g. LAMBDA(acc,val, …).
#SPILL!
Move the formula to a cell that does not intersect the spill area, or reference the range with the @ operator to force a single-cell reference.
#N/A
Wrap the array with IFERROR or FILTER to remove or replace error values before passing it to REDUCE.
ErrorWhy it happensHow to fix it
#VALUE!The LAMBDA is defined with only one parameter, but REDUCE always passes two arguments (accumulator and current value).Rewrite the LAMBDA to accept two arguments, e.g. LAMBDA(acc,val, …).
#SPILL!The array argument is a spilled range that overlaps the cell containing the REDUCE formula, so the result cannot be written.Move the formula to a cell that does not intersect the spill area, or reference the range with the @ operator to force a single-cell reference.
#N/AOne of the cells in the array argument contains a #N/A error; REDUCE propagates that error as soon as it reaches the offending element.Wrap the array with IFERROR or FILTER to remove or replace error values before passing it to REDUCE.

Tips and when to use something else

  • Use LET to store the timesheet array once and reference it multiple times, keeping formulas tidy.
  • When you need every intermediate accumulator value (e.g., a running total), use SCAN instead of REDUCE.
  • For simple numeric aggregation like sum or max, the built-in SUM, MIN, or MAX functions are faster and clearer.
  • Combine REDUCE with BYROW or BYCOL when you want to aggregate across rows or columns while still applying a custom LAMBDA.

Frequently asked questions

How do I use REDUCE to concatenate text from a column?
Pass an empty string as the initial value, feed the target column as the array, and write a LAMBDA that adds the current text to the accumulator, inserting a delimiter only when the accumulator isn’t empty.
Can REDUCE return an array instead of a single value?
Yes, the accumulator can be an array, but the LAMBDA must return an array of the same dimensions on each iteration. This is useful for building up a matrix row-by-row, though SCAN is often a clearer choice for that pattern.
Why does REDUCE give a #VALUE! error when my formula works in Google Sheets but not in Excel?
Excel requires the LAMBDA to have exactly two parameters; Google Sheets is more forgiving and will ignore extra parameters. Ensure your LAMBDA signature matches (accumulator, current) to be portable.
Is REDUCE volatile like SUMIF or does it recalculate only when its inputs change?
REDUCE is non-volatile; it recalculates only when the initial value, array, or LAMBDA definition changes, making it efficient for large datasets.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17