FormulaCraft

REDUCE

REDUCE processes an array element by element, maintaining a running accumulator value that is updated by a LAMBDA function at each step, and returns the final accumulated result. It is used to compute custom aggregations — such as products, string joins, or running totals — that cannot be expressed with standard aggregate functions.

Excel
=REDUCE(0,A2:A5,LAMBDA(acc,x,acc+x))
Google Sheets
=REDUCE(0,A2:A5,LAMBDA(acc,x,acc+x))

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1Choose an initial accumulator value — 0 for sums, 1 for products, or an empty string for text concatenation.
  2. 2Enter =REDUCE(0,A2:A5,LAMBDA(acc,x,acc+x)) to sum all values in A2:A5 starting from 0.
  3. 3Change the LAMBDA body for different aggregations: LAMBDA(acc,x,acc*x) gives the product; LAMBDA(acc,x,acc&", "&x) concatenates with commas.

Need a version for your data?

Try: “Compute the running product of all values in a range using a custom accumulator

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: