Table of Contents
Excel's REDUCE function processes an array one item at a time and returns the final accumulated result. You define the calculation with LAMBDA. It is useful when each step depends on the result of the previous step.
Use an Excel version that supports REDUCE, such as Excel for Microsoft 365. If Excel does not recognize the function, check your version and update channel. Ordinary totals are usually clearer with SUM or SUMIF; REDUCE is most helpful for a custom calculation.

Syntax and the accumulator
=REDUCE(initial_value, array, LAMBDA(accumulator, value, calculation))
| Part | Purpose | Example |
|---|---|---|
| initial_value | The starting result. | 0 for addition, 1 for multiplication, or an empty string for text. |
| array | The values to process. | A2:A4 or {2,3,4}. |
| accumulator | A LAMBDA parameter holding the previous result. | total. |
| value | A LAMBDA parameter holding the current item. | number or city. |
| calculation | The expression producing the next accumulator. | total+number. |
The two parameter names are choices you make, not cell references. The final expression is the LAMBDA body. An accumulator is a running result, not necessarily a cumulative sum; it can hold text or other results as well.
For example:
=REDUCE(0,{2,3,4},LAMBDA(total,number,total+number))
The accumulator starts at 0, becomes 2 after the first value, then 5, then 9. The formula returns 9. Explicitly choosing the starting value makes the intended calculation easier to follow.

Example 1: Count orders from Paris or London
Suppose A2:A9 contains one city per order. This formula adds the number of Paris orders to the number of London orders:
=REDUCE(0,{"Paris","London"},LAMBDA(total,city,total+COUNTIF(A2:A9,city)))

Here, REDUCE iterates through the two criteria, not through each order. COUNTIF counts matching cells for each city, and the accumulator adds those counts. If there are three Paris orders and two London orders, the result is 5.
Keep the criteria list unique to avoid counting the same criterion twice. For more on the underlying function, see TipsMake's COUNTIF guide.
Example 2: Count records containing a category
If cells contain SHIRT(5), PANT(2), and HAT(3), the following formula counts rows beginning with SHIRT( or PANT(:
=REDUCE(0,{"SHIRT","PANT"},LAMBDA(total,category,total+COUNTIF(A2:A7,category&"(*")))

The asterisk is a wildcard after the opening parenthesis. This counts records, not the numbers inside the parentheses. With one SHIRT record and one PANT record, the result is 2 even though their combined quantity is 7.
Example 3: Sum the actual quantities
Enter SHIRT(5), PANT(2), and HAT(3) in A2:A4, respectively. For those consistently formatted values, this formula adds only the SHIRT and PANT quantities:
=REDUCE(0,A2:A4,LAMBDA(total,item,total+IF(OR(TEXTBEFORE(item,"(")={"SHIRT","PANT"}),--TEXTBEFORE(TEXTAFTER(item,"("),")"),0)))
TEXTBEFORE identifies the category. TEXTAFTER and TEXTBEFORE extract the quantity between the parentheses, and the double minus converts it to a number. The result is 7.
This example expects a category followed by a numeric quantity in parentheses. Blank cells, missing delimiters, and nonnumeric quantities need validation before using it on a larger dataset. For regular reporting, separate category and quantity columns are easier to audit. TipsMake's modern Excel function guide covers related text functions.
Common problems
- #NAME? or _xlfn: Check whether your Excel installation supports every function in the formula.
- #VALUE! “Incorrect Parameters”: Check that the REDUCE LAMBDA defines two parameters followed by its calculation.
- Wrong result: Check the seed, duplicated criteria, and whether you are counting records or adding quantities.
- Formula rejected: Your regional settings may use semicolons and different array separators instead of the commas shown here.
Microsoft's REDUCE reference documents the supported syntax and parameter errors.
Reader Comments 0
Sign in with email or Google to join the discussion.