Main content

Excel LAMBDA: Reusable Custom Functions

By Szabó Gergő · Updated

LAMBDA turns an expression into a function you can name and reuse. It is how SCAN, MAP, and REDUCE take custom logic.

Syntax and arguments

=LAMBDA(parameter1, [parameter2], ..., calculation)
parameter
A name the caller will pass in.
calculation
The result using those names.

LAMBDA examples

01
Inline test

Add tax.

=LAMBDA(price,price*1.1)(B2)

The trailing (B2) calls the LAMBDA immediately.

02
SCAN running total

Amounts in B2:B20.

=SCAN(0,B2:B20,LAMBDA(a,b,a+b))

a is the accumulator, b is the next amount.

03
MAP increment

Add 1 to a list.

=MAP(A2:A10,LAMBDA(x,x+1))

Each item is passed to the LAMBDA as x.

Common mistakes

  • Forgetting the call parentheses

    A bare LAMBDA returns #CALC! until you invoke it or store it as a name.

  • Using it in Excel 2016

    LAMBDA needs Microsoft 365.

  • Circular names

    Do not have a named LAMBDA call itself without a stop condition.

LAMBDA FAQ

Where do I save it?

Formulas > Name Manager. Name it TaxIncl and use =TaxIncl(B2).

LAMBDA vs LET?

LET names values inside one formula. LAMBDA names a function you can reuse.

Does Sheets have LAMBDA?

Yes, plus MAP, SCAN, REDUCE, BYROW, and BYCOL.