Skip to main content
← All functions

REDUCE 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)

Square brackets indicate optional arguments.

Arguments

ArgumentRequiredMeaning
initial_valueYesSets the starting value for the accumulator.1
arrayYesAn array to be reduced.A1:C2
lambdaYesA LAMBDA that is called to reduce the array. The LAMBDA takes three parameters: 1.The value totaled up and returned as the final result. 2.The current value from the array. 3.The calculation applied to each element in the array.LAMBDA(a,b,a+b^2)

Try REDUCE

Apply a sequence of changes to an opening balance

=REDUCE(B2,A2:A4,LAMBDA(balance,change,balance+change))

Starting at 100, the running balances are 120,115,125. REDUCE returns only the final balance 125. SCAN can return the intermediate balances as well.

Inspect the current formula

Read its written arguments or observe actual operation values in a separate local calculation. This action neither applies a draft nor grades an answer.

Read the formula, one argument at a time

Explore the written function calls and their inputs. The calculation result belongs to the complete formula.

REDUCE · top-level call

=REDUCE(B2,A2:A4,LAMBDA(balance,change,balance+change))

1 / 3 · initial_value

Sets the starting value for the accumulator.

REDUCE reference ↗

Follow the cells behind a result

Read explicit local references and helper formulas using a separate calculation. Your draft stays in this field; the worksheet and practice checks do not change.

The worksheet runs locally. Published checks apply to the supplied example only. Native Excel and Google Sheets compatibility remain unverified.

Practice a complete task

Reference and compatibility

Univer 1.0.4 / Apache-2.0. Calculation checks cover the supplied examples only. The browser worksheet does not implement every Excel feature, external service or connected data type.