FormulaCraft

How to use LAMBDA with MAP across a range in Excel and Google Sheets

Topic:LAMBDA (reusable formulas)
Excel & Google Sheets
=MAP(A2:A6, LAMBDA(x, IF(x>50, "High", "Low")))

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Place your source values in A2:A6 (e.g. scores: 45, 72, 38, 91, 55).
  2. 2In B2, enter =MAP(A2:A6, LAMBDA(x, IF(x>50, "High", "Low"))) — the formula spills results into B2:B6.
  3. 3The LAMBDA argument x receives each cell value from A2:A6 in turn; the IF body applies your logic.
  4. 4To use two parallel arrays, add a second range: =MAP(A2:A6, B2:B6, LAMBDA(x,y, x*y)) — both arrays must be the same size.
  5. 5Adjust the LAMBDA body for any per-cell transformation: rounding, text cleanup, conditionals, nested functions.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Can MAP return multiple columns?

Not directly from a single MAP call. Use HSTACK or CHOOSECOLS to combine multiple MAP results side by side.

Does MAP work with non-contiguous ranges?

No. MAP requires contiguous range references or array constants. Use VSTACK to combine non-contiguous ranges before passing them to MAP.

What is the difference between MAP and ARRAYFORMULA?

ARRAYFORMULA (Sheets) broadcasts a formula across a range but does not support custom LAMBDA logic. MAP lets you write arbitrary per-element logic with named parameters, which is more expressive.

More on LAMBDA (reusable formulas)

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: