What is LAMBDA in Google Sheets?

LAMBDA defines an anonymous function inside a formula. You name parameters, write the calculation, then pass arguments when you call it. Combined with MAP, BYROW, or a named LAMBDA in the Name manager, it replaces fragile copy-paste logic across big tables.

When to use it

Use LAMBDA when the same multi-step calculation repeats across rows and you want one maintained definition instead of dragged formulas.

When to skip it

Skip LAMBDA for one-line IF tests or when teammates are not ready to read functional style. A simple helper column may be clearer.

How it works

  1. 1

    List parameter names, for example LAMBDA(x, y, x*y+1).

  2. 2

    Write the return expression using those parameters.

  3. 3

    Call immediately with arguments: LAMBDA(x, x*2)(A2).

  4. 4

    Or save a named function via Data > Named functions for reuse across the file.

  5. 5

    Pass the LAMBDA into MAP or BYROW to apply it row by row.

  6. 6

    Document parameter meaning in a Notes tab because LAMBDA is harder to audit than visible columns.

Examples in Google Sheets

Inline double

=LAMBDA(x, x*2)(B2) doubles one cell without a helper column.

MAP over column

=MAP(A2:A, LAMBDA(v, IF(v>100, "High", "Low"))) classifies each value.

Named margin calc

A named LAMBDA margin(cost, price, (price-cost)/price) centralizes pricing logic for the sales team.

Build this without starting from a blank cell

Use a Better Sheets tool for LAMBDA, then watch a walkthrough when you want the full pattern.

Better Sheets resources

Common mistakes

  • Creating LAMBDA without ever naming it, then pasting unreadable nested calls.
  • Wrong argument count when calling a saved named function.
  • Using LAMBDA where BYROW alone with a simpler formula would suffice.
  • Expecting LAMBDA to persist across files without copying named function definitions.
  • Deep nesting that is impossible to debug when one parameter is misspelled.

Frequently asked questions

LAMBDA vs Apps Script?
LAMBDA stays in formulas and updates live. Apps Script handles triggers, APIs, and side effects.
How do I name a LAMBDA?
Use Named functions in the Data menu and paste a LAMBDA definition.
LAMBDA and MAP?
MAP applies a LAMBDA to each item in an array.
Can LAMBDA call itself?
Limited recursion support exists in advanced cases. Most sheet work uses iterative SCAN instead.
Why #NAME? on LAMBDA?
Typo in LAMBDA keyword or calling a named function that was deleted.
LAMBDA performance?
Huge MAP+LAMBDA ranges can slow recalc. Test on thousands of rows before production.
LAMBDA with LET?
LET can hold intermediate values inside a LAMBDA body for readability.

Related glossary terms

Done reading about LAMBDA?

Membership unlocks 636+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.

Need this once

Jump to a free tool or a single tutorial for this topic.

Learning Sheets for real

Unlock the full library, generators, and templates with membership.