LAMBDA Function

Builds your own reusable function — no VBA needed.

Category

Logical

Available in

Microsoft 365, Excel 2024

Returns

A custom function you can name and reuse

Taught hands-on in Level 5: Expert Techniques & Workbook Architecture - Modern Functions module

Overview

LAMBDA turns a formula into a function. You list the inputs (parameters) and the calculation, then save it with a name in Name Manager.

From then on, =AddTax(B2) works anywhere in the workbook, just like a built-in function. LAMBDA is also what powers MAP, BYROW, REDUCE and friends.

Syntax

=LAMBDA([parameter1, parameter2, …], calculation)

Arguments

ArgumentRequired?What it does
parameter1, …OptionalNames for the inputs, up to 253.
calculationYesThe formula to run, using the parameter names. Always the last argument.

Examples

Example 1 — Testing in a cell

Put the inputs in brackets straight after the LAMBDA to try it out.

=LAMBDA(amount, amount*1.13)(100) Explain

This returns 113. Testing this way first saves debugging later.

Example 2 — Saving it as AddTax

In Formulas › Name Manager › New, name it AddTax and set “Refers to” to =LAMBDA(amount, amount*1.13).

C2fx=AddTax(B2)
ABC
1ItemPriceWith tax
2Desk100113
3Chair250282.5
4Lamp4045.2
=AddTax(B2) Explain

Example 3 — Two inputs

A named Margin function: =LAMBDA(cost, price, (price-cost)/price).

=Margin(B2, C2) Explain
Add a comment in Name Manager describing the inputs — it shows up in the formula tooltip.

Common mistakes

  • #CALC! errors. A LAMBDA typed into a cell without inputs after it has nothing to calculate. Call it, or save it in Name Manager.
  • Wrong number of inputs. Calling =Margin(B2) when it needs two gives #VALUE!.

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.