The Excel LAMBDA function lets you write your own custom functions — no VBA, no add-ins. You wrap a calculation and its parameters in LAMBDA, save it under a name, and from then on you call it like any built-in function. It is also the engine behind MAP, REDUCE, BYROW, BYCOL, MAKEARRAY, and SCAN.
DOUBLE and call =DOUBLE(5) anywhere in the workbook.
Syntax
| Argument | Description | |
|---|---|---|
parameter1, … | Optional | Names for the values the function will receive — up to 253 of them. A name must start with a letter, can’t contain spaces, and can’t look like a cell reference (so rate is fine, R1 is not). |
calculation | Required | The formula to evaluate, written using the parameter names. It must be the last argument, and it is the only one that’s required. |
Available in: Excel for Microsoft 365 and Excel for the web only. Excel 2021 and earlier show #NAME?. A LAMBDA on its own returns nothing useful — it has to be called with arguments, either inline or through a defined name.
Step 1: build and test it inline
Before naming anything, prototype the function in a cell. Append the test arguments in parentheses right after the closing parenthesis of the LAMBDA:
That trailing (5) is the part everyone forgets. Without it you defined a function but never ran it — Excel answers with #CALC!.
Step 2: name it — the killer feature
Calling a LAMBDA inline is just for testing. The real power move is saving it as a named function:
- Go to Formulas › Name Manager › New.
- Name:
FAHRENHEIT(this becomes the function name). - Comment: Converts Fahrenheit to Celsius — this shows up as the tooltip.
- Refers to:
=LAMBDA(f, (f-32)*5/9)— note: no trailing arguments here. - Click OK. Now call it anywhere in the workbook like a native function:
| A | B | |
|---|---|---|
| 1 | Fahrenheit | Celsius |
| 2 | 32 | 0.0 |
| 3 | 72 | 22.2 |
| 4 | 98.6 | 37.0 |
| 5 | 212 | 100.0 |
Change the conversion logic once in Name Manager and every cell that calls FAHRENHEIT updates. That’s the maintenance win: business logic lives in one place instead of being copy-pasted into hundreds of cells.
Try it: build a LAMBDA live
Pick a calculation, feed it an input, and watch the inline call evaluate.
Power moves: LET, helpers, and recursion
Inside a LAMBDA, LET keeps multi-step logic readable by naming intermediate results:
LAMBDAs are also what you pass to the array helpers — each one feeds your function a different slice of data:
And because a named LAMBDA can call itself, recursion is possible — the classic example strips every digit from a text string by calling itself until none remain. Handy, but reach for REDUCE first; it covers most looping needs without recursion’s complexity.
Errors & common pitfalls
#CALC! — the LAMBDA was never called, or got too few arguments. =LAMBDA(x, x*2) alone defines a function and stops; Excel can’t display a function, so it returns #CALC!. Same story for =LAMBDA(x, y, x*y)(5) — two parameters declared, one supplied. Add the missing argument(s) in the trailing parentheses.
#NAME? — older Excel. LAMBDA exists only in Excel for Microsoft 365 and Excel for the web. Excel 2021, 2019, and earlier don’t recognize the name — and workbooks with named LAMBDAs will break for those users too.
#VALUE! — illegal parameter name. Parameter names can’t contain spaces, can’t start with a number, and can’t collide with cell references. R1, XFD2, and my rate all fail; rate1 works.
Pitfall: names are workbook-scoped. A named LAMBDA lives in that workbook’s Name Manager. Open a different file and =FAHRENHEIT(72) is #NAME?. Copy a sheet that uses it into another workbook and the name travels along — that’s the easiest way to share one.
Pitfall: calculation must come last. =LAMBDA(x*2, x) is backwards — parameters first, the calculation as the final argument.
Practice workbook
Frequently asked questions
What does the Excel LAMBDA function do?
Why does my LAMBDA return #CALC!?
=LAMBDA(x, x*2) with no trailing (value) — or you supplied fewer arguments than the parameters you declared. Add the arguments in parentheses right after the LAMBDA, or call the named version with a full argument list.How do I save a LAMBDA so I can reuse it?
FAHRENHEIT), put =LAMBDA(f, (f-32)*5/9) in the Refers-to box with no trailing arguments, and add a comment — it becomes the tooltip. Then call =FAHRENHEIT(72) anywhere in that workbook.Which Excel versions support LAMBDA?
Can a LAMBDA call itself (recursion)?
LAMBDA vs LET — what's the difference?
Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class