LAMBDA function in Excel
Create custom, reusable and call them by a friendly name
=LAMBDA([parameter1, parameter2, …, ] calculation)LAMBDA syntax and parameters
Three arguments, one required.
- parameter1anyOptional
A value that you want to pass to the function, such as a cell reference, string or number. You can enter up to 253 parameters. This argument is optional.
- parameter2anyRepeating
- calculationanyRequired
The formula you want to execute and return as the result of the function. It must be the last argument and it must return a result. This argument is required.
LAMBDA examples
Formulas you'll actually reuse.
Define a reusable discount calculation and call it immediately:
=LAMBDA(price, qty, price * qty * 0.9)(B2, C2)Result
224.10Clamp a whole column at zero by mapping a LAMBDA over it:
=MAP(B2:B13, LAMBDA(x, MAX(x, 0)))
LAMBDA in Google Sheets
Same name — your formula ports as-is.
Try LAMBDA in the playground
Edit the example — nothing to install.
Preloaded with the LAMBDA formula from Example 1 — change anything and watch it respond.
LAMBDA errors
What they mean — and the fixes.
#CALC!The LAMBDA was entered without being called — add an argument list after the closing parenthesis, or pass it to MAP/BYROW.
Related functions
More ways Excel gets this done.
- IFSChecks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition.LogicalGoogle Sheets
- LETAssigns names to calculation resultsLogicalGoogle Sheets
- AVERAGEIFReturns the average (arithmetic mean) of all the cells in a range that meet a given criteriaStatisticalGoogle Sheets
- CELLReturns information about the formatting, location, or contents of a cellThis function is not available in Excel for the web.InfoGoogle Sheets
- CSCReturns the cosecant of an angleMathGoogle Sheets
- FILTERFilters a range of data based on criteria you defineLookupGoogle Sheets