LAMBDA
Build your own reusable Excel functions in pure formula language — no VBA, no scripts, no macros. LAMBDA is the biggest addition to Excel in decades, turning the formula bar into a real programming environment.
Creates a function-like formula that accepts parameters and returns a calculated result. Combined with Name Manager, LAMBDA lets you create custom named functions available across the entire workbook.
What LAMBDA does
Until 2022, if you wanted to create a custom function in Excel — say, a temperature converter or an inventory-days calculator — you had exactly two options: paste the same messy formula everywhere, or write VBA. LAMBDA changed that. Now you can define a reusable function directly in the formula bar, give it a name via the Name Manager, and call it like any built-in function throughout your workbook.
The magic is that LAMBDA functions live in the workbook, not in a separate script. They travel with the file. Anyone opening the workbook can use them. No enabling macros, no security prompts, no VBA developer settings. This is the closest Excel has ever come to being a proper functional programming environment — and it's opened the door to sophisticated custom logic that was previously stuck behind the VBA barrier.
💡 The two ways to use LAMBDA
1. Inline (one-off): use LAMBDA directly with arguments passed in the same formula. Good for testing.
2. Named (reusable): save the LAMBDA to Name Manager with a descriptive name like "CelsiusToFahrenheit", then call it as =CelsiusToFahrenheit(A2) anywhere in the workbook. This is where LAMBDA becomes truly powerful.
Syntax breakdown
Named parameters your function accepts. Choose descriptive names like temperature, revenue, rate. Up to 253 parameters allowed. Names must be valid Excel identifiers (no spaces, no starting with a number).
The formula that uses the parameters and produces the result. Can be any valid Excel formula, including nested functions, other LAMBDAs, and array operations.
Values passed to the LAMBDA in parentheses immediately after. Only used for inline invocation. When you save to Name Manager, you'll pass arguments through the named function instead.
How to save a LAMBDA to Name Manager
- Write and test your LAMBDA inline first:
=LAMBDA(c, c*9/5+32)(20)returns 68 (20°C = 68°F). - Once it works, copy just the LAMBDA part (without the trailing arguments):
=LAMBDA(c, c*9/5+32) - Go to Formulas ribbon → Name Manager → New.
- Give it a name like
CelsiusToFahrenheit. Paste the LAMBDA into "Refers to". Click OK. - Now use it anywhere:
=CelsiusToFahrenheit(A2)— behaves like any built-in function.
5 real-world examples
Celsius to Fahrenheit as a reusable function
Inline test then save to Name Manager as CToF.
After saving to Name Manager: =CToF(A2) works anywhere. Clean, readable, self-documenting.
Progressive tax calculation as a reusable function
Multi-bracket tax with clean parameter names. Save as CalculateTax.
Call as =CalculateTax(F2). All the bracket logic hidden behind a clean function name.
Split bill with tax and tip
Three-parameter LAMBDA: subtotal, tax rate, tip percentage, people count. Save as SplitBill.
Descriptive parameter names make the calculation self-documenting. Save to Name Manager for reuse.
Business days until a deadline
Uses NETWORKDAYS internally. Save as BusinessDaysUntil.
Call as =BusinessDaysUntil(dueDate). Wraps a common pattern into readable syntax.
Sum digits of a number recursively
LAMBDAs can call themselves — required saving to Name Manager first. Save as SumDigits.
The LAMBDA calls itself by name — which is why saving to Name Manager is required for recursion. Powerful for tree traversals and cumulative logic.
Common errors and how to fix them
LAMBDA called without arguments
You wrote =LAMBDA(x, x*2) in a cell — this defines the function but doesn't call it, so Excel returns #CALC!.
Named LAMBDA doesn't exist
You wrote =MyFunction(A2) but haven't defined MyFunction in Name Manager. Excel doesn't recognize the name.
Wrong number of arguments passed
Your LAMBDA takes 3 parameters but you passed 2 (or 4). Excel expects exact matches.
Infinite recursion in LAMBDA
Your recursive LAMBDA never hits its base case. Excel stops after 1024 recursion levels.
See our Formula Errors guide for more.
LAMBDA vs LET vs VBA
Version compatibility
Related functions
📥 Download the practice workbook
All 5 examples above with Name Manager entries pre-configured. Includes 10 bonus reusable LAMBDA functions to steal.
Frequently asked questions
Is LAMBDA a replacement for VBA?
For calculations, yes. LAMBDA covers most user-defined function scenarios without VBA. But VBA still wins for anything involving actions — reading files, sending emails, manipulating Excel objects, running macros. Rule of thumb: if it's just math or text processing, LAMBDA. If it interacts with the Excel environment, VBA.
Do LAMBDA functions travel with the workbook?
Yes. LAMBDAs saved to Name Manager are stored in the workbook file itself. Send the file to a colleague, they can use your custom functions immediately. No macro-enabling, no security prompts. This is the biggest advantage over VBA.
Can I create global LAMBDAs available in every workbook?
Not natively. Each LAMBDA lives in its workbook. For cross-workbook sharing, add-ins can distribute LAMBDA libraries — Microsoft's official "Excel Labs" add-in offers this, and the community has built libraries like PowerFX-style LAMBDA collections you can install.
How do I document a LAMBDA for others?
Use descriptive parameter names (revenue not r), name the function clearly in Name Manager, and add a comment in the Name Manager's "Comment" field explaining what it does and what parameters mean.
Can LAMBDA return an array?
Yes. If the calculation produces an array (e.g., using FILTER or SEQUENCE), the LAMBDA returns the whole array. Combined with dynamic arrays, this enables sophisticated one-cell-in, many-cells-out functions.
How do I debug a complex LAMBDA?
Two techniques: (1) use LET inside the LAMBDA to name intermediate values, then output them to check each step; (2) test with tiny inputs first — feed simple values through and verify each stage. Formula → Evaluate Formula also steps through LAMBDA execution.
Are recursive LAMBDAs performant?
For small inputs, yes. For deep recursion (500+ levels), Excel gets slow. If performance matters, prefer iterative solutions using SCAN or REDUCE. Recursion works but isn't Excel's optimization sweet spot.
Custom Excel functions, written for you.
Describe what you want — "function that converts weight units with any input" — and the Add-in writes the LAMBDA and Name Manager entry.
Get the Add-in →