Function · LAMBDA
Excel LAMBDA function
The Excel LAMBDA function defines a custom function. LAMBDA(price, rate, price*rate) called with 49 and 8.25% returns 4.0425. Save it in the Name Manager to call it by name.
Syntax =LAMBDA([parameter, ...], calculation)
=LAMBDA(price,rate,price*rate)(49,0.0825)Arguments
| Name | Required | What to pass |
|---|---|---|
| parameter | Optional | A name for one input. You can take up to 253 parameters. A LAMBDA with no parameters is allowed. |
| calculation | Required | The last argument. It is the result, and it can use the parameter names. |
Examples
A tax function called immediately on $49 at 8.25%
=LAMBDA(price,rate,price*rate)(B1,B2)Result $4.0425
| A | B | |
|---|---|---|
| 1 | Price | 49 |
| 2 | Rate | 8.25% |
| 3 | Tax | 4.0425 |
LAMBDA builds a function. The parameters are price and rate, and the calculation is price times rate. Writing (B1,B2) immediately after it calls that function on $49 and 8.25%, which returns 4.0425. Leave the call off and the cell is #CALC!, because a function that was never called has no value.
The useful form is a named LAMBDA. In the Name Manager, the name Tax can refer to =LAMBDA(price,rate,price*rate). Cells then call =Tax(B1,B2). LET only names values inside one formula. LAMBDA names a function other formulas can call. An optional parameter is written in brackets, as in LAMBDA(price,[rate],price*rate). ISOMITTED is TRUE when the caller left that argument out. MAP, BYROW, BYCOL, REDUCE, SCAN, and MAKEARRAY take a LAMBDA as an argument. BYCOL(B2:E10, LAMBDA(column, SUM(column))) sums each column of the city sales on that page, $16,080, $19,200, $17,850, and $19,690. Excel 2021 has LET and does not have LAMBDA or ISOMITTED.