LAMBDA
Creates a custom, reusable function with named parameters and saves it as a named formula in the workbook. No VBA or macros required.
Spreadsheet editor
Spreadsheet editor
Syntax
=LAMBDA([parameter1, parameter2, ...], calculation)
Returns: Varies Arguments
| Argument | Required | Description |
|---|---|---|
| parameter | No | A named input for your function. You can define up to 253 parameters. Each name must follow Excel's naming rules (no spaces, no reserved symbols). Omit parameters entirely if your function takes no inputs. |
| calculation | Yes | The final argument. This is the formula that runs when the function is called. It can reference any parameter you defined and can use any other Excel function. |
About
The classic workflow has three steps: first, test the calculation formula on its own to make sure it works. Second, wrap it in LAMBDA and call it immediately in a cell to confirm the result (for example,
=LAMBDA(x, x * 1.1)(100) returns 110). Third, open the Name Manager, paste the LAMBDA there without the immediate call, and give it a friendly name like AddTax. From that point on, you can use =AddTax(100) anywhere in the workbook.LAMBDA pairs naturally with array functions like MAP, REDUCE, and BYROW that accept a function as an argument. You can also use LAMBDA to simplify long, repeated formulas into a single reusable name, making your spreadsheets cleaner and easier to maintain. Combine it with IF or IFS inside the calculation to handle branching logic. It is available in Excel for Microsoft 365 and Excel 2024.
Examples
Three-parameter LAMBDA for bulk order pricing
Spreadsheet editor
Watch out for
Using LAMBDA in a cell without calling it
If you enter =LAMBDA(x, x + 1) in a cell and press Enter, Excel returns a #CALC! error. The function was defined but never executed.
→ Always invoke the LAMBDA immediately when testing in a cell by adding the argument list in parentheses right after the closing bracket, for example =LAMBDA(x, x + 1)(5). Move the definition to the Name Manager only after confirming the result is correct.
Parameter names that conflict with cell references
Naming a parameter something like A1 or B2 causes confusion because Excel may interpret it as a cell address rather than a parameter.
→ Use descriptive names that are not valid cell references, such as price, rate, qty, or inputVal. Short but meaningful names also make the formula easier to read when others open the workbook.
Exceeding 253 parameters
Defining more than 253 parameters in a single LAMBDA returns a #VALUE! error.
→ Redesign the function to accept arrays or ranges as single parameters instead of passing many individual values. For example, pass an entire column as one parameter and use SUM or FILTER inside the calculation.
Forgetting to save to the Name Manager
A LAMBDA written inline in a cell is only available in that cell. Typing the same formula in another cell does not share it workbook-wide.
→ Open the Name Manager (Formulas tab), create a new name, and paste the LAMBDA definition (without the immediate call) into the Refers To field. This makes the custom function available everywhere in the workbook.