The SCAN function revolutionizes how Excel users handle sequential array calculations. This powerful tool, available in Excel 365, enables you to perform cumulative operations across arrays while maintaining a record of each step. Whether you’re tracking running totals or building complex calculation chains, SCAN offers unprecedented control over array processing.
Create Your First SCAN Function in Excel
Let’s start with the fundamentals of implementing SCAN in your spreadsheets.
Basic SCAN Syntax Structure
The SCAN function uses this format:
=SCAN(initial_value, array, lambda_function)
Step 1: Prepare Your Data
- Open a new Excel worksheet
- Enter a simple number sequence in cells A1:A5 (for example, 1,2,3,4,5)
- Select cell B1 for your first SCAN formula
Step 2: Write Your First SCAN Formula
- Type the following formula:
=SCAN(0,A1:A5,LAMBDA(accumulator,current,accumulator+current))
This formula will create a running sum, where:
- 0 is the initial value
- A1:A5 is your input array
- The LAMBDA function defines how to process each element
Example Output:
Input (A) |
Running Sum (B) |
---|---|
1 |
1 |
2 |
3 |
3 |
6 |
4 |
10 |
5 |
15 |

How to Use SCAN for Running Totals
SCAN excels at creating progressive calculations across data sets.
Creating a Running Sum
Step 1: Set Up Your Data
- Input your values in column A
- Create a running total using:
=SCAN(0,A1:A10,LAMBDA(acc,curr,acc+curr))
Building a Progressive Multiplication Series
Step 1: Define Your Multiplication Pattern
- Use this formula for cumulative multiplication:
=SCAN(1,A1:A5,LAMBDA(acc,curr,acc*curr))
Example:
Input |
Progressive Product |
---|---|
2 |
2 |
3 |
6 |
4 |
24 |
5 |
120 |

Applying SCAN with Custom LAMBDA Functions
SCAN becomes more powerful when combined with custom LAMBDA functions.
Step 1: Create a Custom LAMBDA
- Define a LAMBDA for complex calculations:
=SCAN(0, A2:A6, LAMBDA(acc, curr, IF(curr > 0, acc + curr, acc)))


Stop exporting data manually. Sync data from your business systems into Google Sheets or Excel with Coefficient and set it on a refresh schedule.
Get Started
Step 2: Implement in SCAN
- Use your LAMBDA within SCAN:
=SCAN(0,A1:A10,myCustomLambda)
Real-World SCAN Applications
Financial Data Processing
Step 1: Calculate Running Investment Returns
- Set up your monthly return percentages
- Use SCAN to calculate cumulative growth:
=SCAN(1,A1:A12,LAMBDA(acc,curr,(1+curr)*acc))

Inventory Tracking
Step 1: Track Running Stock Levels
- List your daily inventory changes
- Implement SCAN for running balance:
=SCAN(initial_stock,changes,LAMBDA(acc,curr,acc+curr))

What Makes SCAN Different from Other Array Functions
SCAN distinguishes itself through its ability to maintain calculation history:
Feature |
SCAN |
REDUCE |
MAP |
---|---|---|---|
Returns |
Array |
Single Value |
Array |
History |
Yes |
No |
No |
Progressive |
Yes |
No |
No |
Taking Your SCAN Skills Further
SCAN’s versatility makes it an essential tool for Excel power users. Practice combining it with other array functions for more complex calculations. Remember to start simple and gradually build up to more sophisticated implementations.
Ready to supercharge your Excel workflows? Try Coefficient to enhance your data processing capabilities and take your spreadsheet automation to the next level. Get started with Coefficient today.