LAMBDA

Creates a custom, reusable function with named parameters and saves it as a named formula in the workbook. No VBA or macros required.

Logical
|
Excel 365 only
|
Google Sheets Supported

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

LAMBDA lets you build your own custom functions directly inside Excel, without writing any VBA or macros. You give the function a name, define one or more input parameters, and write a formula that uses those parameters. Once you save it in the Name Manager, you can call your function anywhere in the workbook just like a built-in function.

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

Use LAMBDA with three named parameters to combine price, discount, and quantity into one clean formula. Edit any price, discount rate, or quantity to see the total recalculate. Once you save this to the Name Manager, one function call replaces the nested arithmetic everywhere.

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.

Tips & notes

LAMBDA functions are stored in the Name Manager alongside named ranges, so you can edit or delete them from Formulas > Name Manager at any time. In Google Sheets, LAMBDA uses the same syntax but the name-saving workflow differs: wrap your LAMBDA in a named function via Data > Named functions. LAMBDA also supports recursive calls when the function name is defined, enabling loops without helper columns.

Common questions

Do I need to know VBA to use LAMBDA?

No. LAMBDA is a pure formula-based feature. You write standard Excel syntax inside it, save it in the Name Manager, and call it like any built-in function. No programming background is required.

Can a LAMBDA function call itself recursively?

Yes. Once you save the LAMBDA under a name in the Name Manager, the calculation argument can reference that same name to recurse. This lets you build iterative logic such as factorial calculations or custom aggregations without helper columns.

Is my LAMBDA available in other workbooks?

By default, a LAMBDA saved in the Name Manager is scoped to the workbook it was created in. To share it, copy the named range to another workbook, or store it in a shared template that other files are based on.

What is the difference between LAMBDA and LET?

LET assigns names to intermediate values inside a single formula to avoid repetition and improve readability. LAMBDA creates a reusable function that can be called multiple times across the workbook. Use LET when you need cleaner one-off formulas, and LAMBDA when the same logic needs to be applied in many places.