SCAN Function in Excel: Running Totals in One Formula

⏱ 1 min readUpdated 28 September 2026

LogicalLevel: ExpertAvailable in: Excel 365 / 2021+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Example 2
  5. Related functions

SCAN walks through an array carrying an accumulator and returns every intermediate result — running totals, running balances, running max.

Syntax

=SCAN(initial_value, array, LAMBDA(acc, value, calculation))
Argument What it means
initial_value Starting accumulator, often 0.

Examples

Example 1

=SCAN(0, C2:C366, LAMBDA(a, v, a+v))

Running total of daily sales.

Example 2

=SCAN(B1, C2:C50-D2:D50, LAMBDA(a, v, a+v))

Running bank balance from credits and debits.

REDUCE · MAP · SUM

📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong