ExcelExcel 2024+
SCAN function in Excel
Scans an array by applying a LAMBDA to each value and returns an array that has each intermediate value
=SCAN([initial_value], array, lambda(accumulator, value, body))SCAN syntax and parameters
Three arguments, two required.
- initial_valueanyOptional
- arrayarrayRequired
- lambda(accumulator, value, body)anyRequired
SCAN examples
Formulas you'll actually reuse.
A running total down the column — every intermediate value:
=SCAN(0, D2:D200, LAMBDA(acc, x, acc + x))The record-to-date — the biggest deal seen so far on each row:
=SCAN(0, D2:D200, LAMBDA(acc, x, MAX(acc, x)))
SCAN in Google Sheets
Same name — your formula ports as-is.
Try SCAN in the playground
Edit the example — nothing to install.
Preloaded with the SCAN formula from Example 1 — change anything and watch it respond.
Loading the editor…
Related functions
More ways Excel gets this done.
- ANDReturns TRUE if all of its arguments are TRUELogicalGoogle Sheets
- BYCOLApplies a LAMBDA to each column and returns an array of the resultsLogicalGoogle Sheets
- BYROWApplies a LAMBDA to each row and returns an array of the resultsLogicalGoogle Sheets
- FALSEReturns the logical value FALSELogicalGoogle Sheets
- IFSpecifies a logical test to performLogicalGoogle Sheets
- IFERRORReturns a value you specify if a formula evaluates to an error; otherwise, returns the result of the formulaLogicalGoogle Sheets