TX Sheet Control

REDUCE Function

Function

Reduce an array to a single value by applying a LAMBDA to each element in turn. array_or_initial is the start value of the accumulator (empty when omitted), array_or_lambda the array, and lambda a LAMBDA with two parameters, the accumulator and the current element, whose result becomes the new accumulator. A third argument that is not a LAMBDA with two parameters returns #VALUE!. SCAN returns every intermediate value instead.

Syntax

REDUCE(array_or_initial, array_or_lambda, lambda)

Category: Logical. Minimum arguments: 3. Maximum arguments: 3.

Available for supported offline calculation.

Examples

=REDUCE(0,{1,2,3},LAMBDA(acc,x,acc+x))

The formula returns 6, the sum of 1, 2 and 3.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

See Also