Spread.NET 18 Formula Reference
Formula Functions / Functions R to S / REDUCE
In This Topic
    REDUCE
    In This Topic

    This function reduces an array to an accumulated value by applying a LAMBDA to each value and returning the total value in the accumulator. 

    Syntax

    REDUCE([initial_value], array, lambda(accumulator, value))

    Argument

    This function has the following arguments:

    Argument Description
    [initial_value] (Optional) Sets the starting value for the accumulator.
    array

    An array to be reduced.

    lambda

    A LAMBDA that is called to reduce the array. The LAMBDA takes two parameters:

    accumulator: The value totaled up and returned as the final result.

    value: The calculation applied to each element in the array.

    Remarks

    If an invalid LAMBDA function or an incorrect number of parameters are provided, it returns a #VALUE! error called "Incorrect Parameters".

    Data Types

    Returns a numerical value.

    Examples

    REDUCE(, A1:C2, LAMBDA(a,b,a+b^2))

    REDUCE(1,Table2[Nums],LAMBDA(a,b,IF(b>50,a+b,a)))

    Version Available

    This function is available in product version 15 or later.