TX Sheet Control

SCAN Function

Function

Apply a LAMBDA to each element of an array in turn and return every intermediate value as an array. 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. The result has the size of the array and spills. A third argument that is not a LAMBDA returns #VALUE!. REDUCE returns only the final value.

Syntax

SCAN(array_or_initial, array_or_lambda, lambda)

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

Available for supported offline calculation.

Examples

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

The formula returns the running totals 1, 3 and 6.

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

See Also