1. Home
  2. Functions
  3. Array
  4. REDUCE

REDUCE function

Reduces an array to one value by applying a LAMBDA to an accumulator and each value.

Syntax

=REDUCE(initial_value, array, lambda)

Arguments

ArgumentRequiredDescription
initial_valueRequiredThe starting accumulator
arrayRequiredThe array to go through
lambdaRequiredLAMBDA(accumulator, value)

How to use REDUCE

When REDUCE returns more than one value, the result spills into the cells below and to the right. Keep those cells empty, or you get #SPILL!.

REDUCE takes 3 required arguments. Type =REDUCE( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=REDUCE(0, {1,2,3}, LAMBDA(a, v, a+v))Result 6
=REDUCE(1, {2,3,4}, LAMBDA(a, v, a*v))Result 24

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.