Yes. In Microsoft 365 Excel for Windows, you can save a LAMBDA formula as a defined name in Formulas > Name Manager, then call that name in worksheet formulas like a built-in function. The key is to define the LAMBDA first and give it a valid name; putting an unfinished LAMBDA directly in a cell will not create a reusable function.
What LAMBDA in Name Manager means
LAMBDA lets you turn a formula into a custom, reusable function without writing VBA. Name Manager stores that formula under a name you choose. For example, you might save a calculation as NetPrice and then use =NetPrice(A2,B2) in a worksheet. Excel evaluates the named LAMBDA using the values supplied as its arguments.
This is different from creating a new function that is available in every workbook. A name is saved in the workbook where you create it, so another workbook will not automatically recognize it. You can copy the defined name or the sheet/workbook content as appropriate, but the definition must be available in the workbook where you want to call it.
LAMBDA is available in Microsoft 365 Excel and Excel 2024. It is not supported in older perpetual versions such as Excel 2021. If a workbook containing LAMBDA is opened in an unsupported version, the formula may not calculate correctly and may display an unsupported-function indicator or an error.
Create a named LAMBDA in Excel for Windows
In Microsoft 365 Excel for Windows, use the following steps:
- Choose a short, descriptive function name, such as
NetPrice. - Open Formulas > Name Manager, then select New.
- Enter the function name in the Name box. Leave Scope set to Workbook if the function should be available throughout the workbook.
- In Refers to, enter the LAMBDA definition, beginning with an equals sign.
- Select OK, close Name Manager, and call the named function from a worksheet cell.
For a concrete example, assume prices are in A2:A20 and discount rates are in B2:B20. In Name Manager, use NetPrice as the name and enter =LAMBDA(price,discount,price*(1-discount)) in Refers to. In C2, enter =NetPrice(A2,B2) and fill the formula down. If A2 contains 100 and B2 contains 20%, the result in C2 is 80.
The first items inside LAMBDA, here price and discount, are parameter names. The expression after the final comma is the calculation Excel returns. The parameters act as placeholders: when the worksheet calls NetPrice(A2,B2), Excel substitutes the value from A2 for price and the value from B2 for discount.
Test the formula before saving it
It is often easier to build and check a LAMBDA in a worksheet cell before adding it to Name Manager. A LAMBDA definition needs to be called with arguments to return a result. For the same example, assuming A2 contains 100 and B2 contains 20%, enter =LAMBDA(price,discount,price*(1-discount))(A2,B2) in a test cell. The result should be 80. Once the calculation works, copy the definition into Name Manager and remove the final call portion, leaving the definition itself.
That distinction matters. A LAMBDA expression entered by itself in a cell has no supplied arguments, so Excel cannot complete the calculation and can return #CALC!. The saved definition in Name Manager is also not meant to display a result on its own; it is a function for a later call. Testing with sample values helps catch arithmetic or argument-order mistakes before you use the function across a large range.
Write a brief comment in Name Manager when the function’s purpose or argument order might not be obvious. For example, a note that the first argument is the price and the second is a decimal discount rate can prevent someone from reversing the inputs. Comments are especially useful when a workbook has several custom functions.
Choose clear names and arguments
A defined name must follow Excel’s naming rules. Names cannot contain spaces, cannot look like a cell reference such as A1, and should begin with a letter, underscore, or backslash. Use letters, numbers, periods, and underscores rather than punctuation or spaces. A readable name such as NetPrice is easier to understand than an abbreviated label such as NP2.
Parameter names also need to be valid Excel names. Prefer words that explain what each input represents, and keep the parameter order consistent with the way a user would naturally supply the information. A function with several arguments becomes difficult to call if the names and their order are not clear. Avoid parameter names that could be confused with a cell address or a built-in function.
For a second example, assume a value is in A2 and the lower and upper limits are in B2 and C2. A named LAMBDA called LimitValue could use =LAMBDA(value,low,high,MAX(low,MIN(value,high))). The worksheet call in D2 would be =LimitValue(A2,B2,C2). If A2 is 14, B2 is 0, and C2 is 10, the result is 10. This can make a repeated rule easier to audit than copying a nested expression into many cells.
Workbook scope, sharing, and compatibility
For most custom functions, choose Workbook scope. That makes the name available to formulas on different sheets in the same workbook. A worksheet-scoped name is limited to its particular sheet and may make formulas elsewhere harder to follow. Scope is selected when creating a name, so check it in Name Manager if a function works on one sheet but is not recognized on another.
Defined names travel with the workbook, not with an individual formula copied into a separate file. If you share a workbook, tell recipients that it uses LAMBDA and consider their Excel version. Microsoft 365 Excel on Windows and Excel 2024 support LAMBDA; Excel 2021 and earlier releases do not. If recipients use different software or older Excel versions, consider replacing the named function with ordinary formulas or providing a compatible copy.
On Excel for Mac, LAMBDA is available in supported Microsoft 365 versions, but ribbon labels and dialog layouts can differ slightly from Windows. Look for Name Manager or Define Name on the Formulas tab and use the same name and Refers to definition. Excel for the web also has its own interface and feature changes over time, so the Windows ribbon steps above apply specifically to the requested Microsoft 365 desktop workflow.
Common errors and how to fix them
#CALC!: The LAMBDA may have been entered in a cell without being called with arguments. Test it by appending a call with sample values, or use the saved name with the required arguments.#VALUE!: Check the number of arguments. A function defined with two parameters expects two supplied arguments; leaving one out or adding an extra one causes a mismatch.#NAME?: Check the spelling of the defined name, its scope, and whether the workbook actually contains the definition. Also check whether the Excel version supports LAMBDA.- Unexpected results: Confirm the argument order, the cell references, and the assumed data types. A discount entered as 20 rather than 20% or 0.2, for instance, changes the arithmetic substantially.
- Worksheets cannot find the function: Inspect the name’s Scope in Name Manager. A name scoped to one sheet is not the same as a workbook-scoped name.
When troubleshooting, test the underlying calculation with a small, known example before changing the name definition. For the net-price example, a price of 100 and a discount of 20% should produce 80. If that test fails in a worksheet call, separate the problem into two questions: does the LAMBDA expression calculate as expected, and does the defined name point to that expression?
When a named LAMBDA is useful
A named LAMBDA is useful when the same multi-step calculation appears repeatedly and deserves one consistent definition. Typical candidates include a standard text-cleaning rule, a repeated unit conversion, a recurring eligibility test, or a calculation used across many sheets. Changing one definition can then update every formula that calls the name, which is easier to maintain than editing multiple copies of a long formula.
It is not automatically better to wrap every short calculation in a custom function. A simple formula used once may be clearer left in the cell. Also, named LAMBDAs can hide their logic from someone who does not know to inspect Name Manager. Use descriptive names, comments, and straightforward arguments, and avoid creating a large collection of overlapping functions.
LAMBDA can also be combined with other Excel functions inside its definition, including functions that transform or test arrays. Support for some newer functions depends on the Excel release, however, so check compatibility before using a more advanced formula in a workbook shared across organizations. The basic LAMBDA feature does not require VBA, macros, or add-ins.
Frequently Asked Questions
Can I use LAMBDA directly in Name Manager?
Yes. Create a new defined name, enter a LAMBDA definition in Refers to, and save it. Then call the name in a cell with the number of arguments that the LAMBDA expects.
Why does my LAMBDA return #CALC!?
A LAMBDA entered in a cell without a call has no argument values to work with. Append arguments for a test, or call the saved name with the required inputs. Check that the definition itself has balanced parentheses and the intended calculation.
Does a named LAMBDA work in every Excel workbook?
No. The name belongs to the workbook where it is defined. To use the function in another workbook, that workbook also needs the definition, and it must be opened in an Excel version that supports LAMBDA.
Can I use LAMBDA without VBA?
Yes. LAMBDA is a built-in worksheet function, and a named LAMBDA is saved as a defined name. It does not require a macro or VBA code.
Which Excel versions support LAMBDA?
LAMBDA is available in Microsoft 365 Excel and Excel 2024. It is not supported in Excel 2021 or earlier perpetual versions, so check compatibility when sharing a workbook with people using older software.
Related
- Is Excel Free? Microsoft 365 Plans and Free Options
- Excel Value Formatting: What It Changes and How to Use It
- Text to Excel Converter: Import Text Into Columns
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel INDIRECT Drop-Down Lists: Setup and FixesTo make a dependent drop-down list in Excel, create a named range for each set of choices, then…
- SUMIFS in Excel: Count or Sum Matching Values?SUMIFS in Excel adds numeric values that meet one or more conditions; it does not normally count matching…
- Excel Power Automate Filter Query: Syntax and ExamplesIn Power Automate, filter Excel table rows by entering an OData-style condition in the Filter Query field of…
- Excel Formula to Count Cells With Text in Any RangeTo count cells containing text in Excel, use =COUNTIF(A2:A100,"*"), replacing A2:A100 with your range. The asterisk is a…
- Excel Last Day of Month: Formula and ExamplesTo return the last day of the month for a date in Excel, use =EOMONTH(A2,0), where A2 contains…
- Calculate Age in Excel from DOB with a Simple FormulaIf the date of birth (DOB) is in A2, enter =DATEDIF(A2,TODAY(),"Y") in another cell to return age in…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.