October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

How to Use Excel’s LAMBDA Helper Function with SCAN

Excel’s SCAN function uses a LAMBDA update rule to return every intermediate result. Learn the arguments, running calculation patterns, availability, and fixes for common errors.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use SCAN with a LAMBDA when you want Excel to return every step of a running calculation—not just the final result. Start with an initial value, supply the array to process, then tell the LAMBDA how to combine the accumulated result with each current item.

How SCAN and LAMBDA work together

Microsoft describes SCAN as scanning an array by applying a LAMBDA to each value and returning an array of intermediate results. Its syntax is:

=SCAN([initial_value], array, LAMBDA(accumulator, value, body))

Think of the LAMBDA as an update rule: new accumulator = a calculation using the old accumulator and the current item. SCAN starts with the initial value, applies that rule to the first item, carries the result forward, and repeats for each item. The returned array contains the result at each step.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Microsoft Excel Laminated Two-Sided Keyboard Shortcut Guide - Windows Edition
  • Over 215 Microsoft Windows Excel Shortcuts
  • Two-Sided Durable Laminiated Sheet
  • Designed for Excel on a Windows Computer
  • initial_value sets the accumulator’s starting state. Use 0 for a running sum, 1 for a running product, or "" for text concatenation. Microsoft specifically recommends an empty string when working with text.
  • array is the range or array whose values Excel processes.
  • accumulator is the result carried over from the previous step.
  • value is the current item in the array.
  • body is the expression that calculates the next accumulator. In the examples below, LAMBDA(a,v,a+v) means “add the current value, v, to the prior accumulated result, a.”

The parameter names are labels you choose; they do not have to be literally accumulator and value. Follow Excel’s naming rules, including its restriction against periods in parameter names. The LAMBDA calculation expression must be its final argument and return a result. See Microsoft’s SCAN function documentation and LAMBDA function documentation.

Build a running calculation

Running total

If the numbers are in A1:A5, enter:

=SCAN(0,A1:A5,LAMBDA(a,v,a+v))

Excel starts at zero, adds each current cell to the total so far, and returns the successive totals as a spilled array. For example, if the cells contain 2, 4, and 3, the corresponding results are 2, 6, and 9.

Running product

For a cumulative product over a vertical range such as A1:A4, use:

Rank #2
Sale
Microsoft Surface Pro Keyboard with Pen Storage, Compatible with Copilot+ (11th Edition), Surface 9 and 8, Alcantara Material, Black
  • Instant Copilot. Unlock new possibilities with the dedicated Copilot key, which gives you instant access to experiences that can enhance your productivity¹.
  • Enhance your experience With the new microphone mute key and snipping key
  • Full keyboard experience. Features a full mechanical keyset, backlit keys, and a large trackpad for precise navigation and control. Optimal key spacing allows fast, fluid typing.
  • Slim and compact Performs like a traditional, full-size keyboard.
  • Clicks in place instantly Use in combination with the Surface Pro (11th Edition), Pro 9 and Pro 8* kickstand for a perfect laptop experience anywhere.

=SCAN(1,A1:A4,LAMBDA(a,v,a*v))

The starting value is one, and each step multiplies the previous product by the current value. Microsoft’s documented product example uses a two-dimensional range:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

=SCAN(1, A1:C2, LAMBDA(a,b,a*b))

Microsoft describes this as creating a list of factorials; the actual results depend on the values in the supplied range.

Cumulative text

To append each value in a range to the text accumulated so far, use an empty string as the initial value:

Rank #3
Pixiecube Excel Cheat Sheet Desk Pad | Excel Shortcut Keys Mouse Pad | Extended Large XL Gaming Mousepad | PC Office Spreadsheet Keyboard Mat | Non-Slip Stitched Edge
  • EXCEL SHORTCUTS. ZERO SEARCHING. – Our bestselling reference mat puts an extensive collection of commonly used commands, formulas and helpful tricks directly beneath your fingertips so you can find answers fast, work smarter and stay in the flow.
  • YOUR DESK. SMARTER. – Clearly organized sections for navigation, selection, formatting, data and functions make it easy to find the right Excel command exactly when you need it.
  • LEARN, WORK & RESET – Built-in desk-exercise diagrams give you 10 quick ways to stretch, recharge and return to work feeling sharper.
  • ROOM TO WORK & CREATE – The extended 31.5 x 11.8-inch Pixiecube desk mat fits a laptop or keyboard and mouse, while the soft 2 mm surface adds comfort and protects your desktop.
  • BUILT FOR REAL-WORLD WORKDAYS – A rugged stitched edge helps prevent fraying, and the water-resistant, stain-resistant surface protects against scratches, spills and everyday wear—because smarter desks should work harder.

=SCAN("",A1:C2,LAMBDA(a,b,a&b))

The & operator joins the prior text and current value, so the output contains progressively longer concatenations. This is Microsoft’s documented text pattern.

Other stateful patterns

The same structure can update a running state in other ways. These are illustrative patterns derived from the accumulator rule:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Running maximum: =SCAN(A1,A1:A5,LAMBDA(a,v,MAX(a,v))) carries forward the larger of the prior maximum and current value. Starting with A1 includes the first item as the initial maximum.
  • Conditional running count: =SCAN(0,A1:A5,LAMBDA(a,v,a+(v>10))) adds one when the current value is greater than 10 and otherwise keeps the count unchanged. Replace 10 with the threshold you need.

Choose SCAN when you need every step

SCAN is one of several Excel functions that use LAMBDA expressions. Choose among them based on the shape of the result you need:

Rank #4
Sale
Incase Wired Keyboard 600 – Designed by Microsoft – Spill Resistant, Quiet Touch Keys, Plug and Play, 4 Hotkeys, Windows Start Key – Black
  • Efficient Media Controls: The Wired Keyboard 600, designed by Microsoft, features a Media Center with four hot keys for easy control of play/pause, volume up, volume down, and mute functions.
  • Quiet and Responsive Keys: Enjoy a comfortable typing experience with quiet, thin-profile keys that are both responsive and efficient.
  • Convenient Shortcuts: Quickly access common tasks with dedicated shortcut keys, including a calculator hot key and a Windows start screen key.
  • Spill-Resistant Design: Work confidently with a spill-resistant design that protects your keyboard from accidental messes.
  • Plug-and-Play Simplicity: No software needed—just connect the keyboard to your PC and start using it right away, with a full number pad for efficient data entry.
Function What it returns Use it when
SCAN Each intermediate accumulated result You need to see the running progression.
REDUCE The final accumulated result You need only the final aggregate or state.
MAP An array of transformed values Each item should be transformed independently.
BYROW / BYCOL Results of applying a LAMBDA by row or column The calculation should operate at row or column granularity.

Microsoft summarizes these functions in its logical functions reference.

Check that your Excel version includes SCAN

Microsoft lists SCAN and LAMBDA for Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, and Excel 2024 for Mac. Its alphabetical function catalog marks both as introduced in 2024; that marker identifies the introduction version, not a more specific rollout date or build. If you use an older perpetual edition, check whether the functions are available in your copy before building a workbook around them. See Microsoft’s alphabetical function catalog and function catalog by category.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot SCAN and LAMBDA formulas

#VALUE! with “Incorrect Parameters”

Microsoft says SCAN returns #VALUE! with “Incorrect Parameters” when its LAMBDA is invalid or has the wrong parameter count. Check that the arguments to SCAN are in this order: initial value, array, LAMBDA. The inner LAMBDA needs to accept the accumulator and current value, and its calculation must produce the next result. Also check that parentheses and your locale’s argument separators match.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
SYNERLOGIC Microsoft Word/Excel (for Windows) Reference Guide Keyboard Shortcut Sticker, Laminated, No-Residue Vinyl (White/Small)
  • 💻 ✔️ EVERY ESSENTIAL SHORTCUT - With the SYNERLOGIC Reference Keyboard Shortcut Sticker, you have the most important shortcuts conveniently placed right in front of you. Easily learn new shortcuts and always be able to quickly lookup commands without the need to “Google” it.
  • 💻✔️ Work FASTER and SMARTER - Quick tips at your fingertips! This tool makes it easy to learn how to use your computer much faster and makes your workflow increase exponentially. It’s perfect for any age or skill level, students or seniors, at home, or in the office.
  • 💻 ✔️ New adhesive – stronger hold. It may leave a light residue when removed, but this wipes off easily with a soft cloth and warm, soapy water. Fewer air bubbles – for the smoothest finish, don’t peel off the entire backing at once. Instead, fold back a small section, line it up, and press gradually as you peel more. The “peel-and-stick-all-at-once” method only works for thin decals, not for stickers like ours.
  • 💻 ✔️ Compatible and fits any brand laptop or desktop running Windows 10 or 11 Operating System.
  • 💻 ✔️ Original Design and Production by Synerlogic Electronics, San Diego, CA, Boca Raton, FL and Bay City, MI, United States 2020. All rights reserved, any commercial reproduction without permission is punishable by all applicable laws.

#CALC! from a bare LAMBDA

A LAMBDA entered by itself in a cell without being called returns #CALC!. Test a LAMBDA by calling it directly in a cell first:

=LAMBDA(number,number+1)(1)

This immediate call returns 2. Once a more complicated LAMBDA works, you can make it reusable through Name Manager in Excel for Windows or Define Name on Mac. Workbook scope is the default; sheet scope is also available, while Excel for the web does not offer sheet scope. Microsoft’s LAMBDA documentation also notes that a LAMBDA can accept up to 253 parameters and that too many circular recursive calls can produce #NUM!; those are general LAMBDA behaviors, not SCAN’s incorrect-parameter message.

Formula separators and spilled results

If your Excel locale uses semicolons between arguments, replace the commas in the examples with the separators your Excel expects. SCAN returns an array of intermediate values, so the output needs room to spill into adjacent cells; clear any cells blocking the intended result area if Excel cannot display the array.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.