Skip to content
Google Sheets

LAMBDA function in Google Sheets

Creates and returns a custom function with a set of names and a formula_expression that uses them. To calculate the formula_expression, you can call the returned function with as many values as the name declares.

=LAMBDA(name, formula_expression)

LAMBDA syntax and parameters

Two arguments, two required.

  • nameanyRequired

    The name to be used inside the formula_expression. This name must be an identifier and resolves to the actual value passed to the custom function returned by LAMBDA.

  • formula_expressionanyRequired

    The formula to be calculated. It uses names declared in previous parameters.

LAMBDA examples

Formulas you'll actually reuse.

  1. Define a reusable discount calculation and call it immediately:

    =LAMBDA(price, qty, price * qty * 0.9)(B2, C2)

    Result224.10

  2. Clamp a whole column at zero by mapping a LAMBDA over it:

    =MAP(B2:B13, LAMBDA(x, MAX(x, 0)))

LAMBDA in Excel

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.

Loading the editor…

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.