Skip to main content
← All functions

SCAN function

Scans an array by applying a LAMBDA to each value and returns an array that has each intermediate value.

Syntax

SCAN(initial_value, array, lambda)

Square brackets indicate optional arguments.

Arguments

ArgumentRequiredMeaning
initial_valueYesSets the starting value for the accumulator.1
arrayYesAn array to be scanned.A1:C2
lambdaYesA LAMBDA that is called to scanned 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 SCAN

Show every intermediate running balance

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

SCAN applies +20,-5,+10 to opening balance 100 and returns each updated balance. The opening value itself is not an extra output row.

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.

SCAN · top-level call

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

1 / 3 · initial_value

Sets the starting value for the accumulator.

SCAN 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.