Numbers MAP: Transform Array Values with LAMBDA and INDEX
Transform each Numbers array value with MAP, extract an explicit result grid with INDEX and compare square, clipping and total calculations.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
MAP applies a LAMBDA calculation to every value in an array and returns an array of the transformed values. Squaring a three-by-three input gives nine squares, rather than one row total or one grand total.
This guide uses INDEX to place each result in a specific cell. You can compare the mapped grid with the original without overwriting either.
Availability and version history
- Introduced: The original introduction release and date are not established by the checked references. LAMBDA’s separately documented introduction does not establish this helper’s first release.
- Availability: Currently documented in Apple’s Functions Help 15.4 documentation edition; no final supported-version endpoint is established.
- Scope: Shared iWork reference. Function-specific historical Mac, iPad, iPhone and iCloud endpoints are unverified.
- Checked: October 14, 2026, against the official MAP reference. Examples were independently calculated; no native Numbers test was performed.
Syntax and the value parameter
MAP(array, array…, LAMBDA(parameter, calculation))
Apple’s MAP reference lists an input array, additional input arrays and a LAMBDA calculation. The calculation is required and goes last inside LAMBDA. In the one-array form used here, the parameter represents the current value:
=MAP(B2:D4,LAMBDA(reading,reading^2))
The short reference does not explain every multi-array shape or parameter-count combination. The examples below deliberately use one rectangular numeric array and one parameter. The ellipsis in the signature describes additional arguments; it is not text to paste into a formula.
Build a signed numeric grid
Create MatrixMap, with twelve columns A:L and eight rows, including one header row. Label B1:D1 Input 1, Input 2 and Input 3. Enter these values in B2:D4:
| Row | B | C | D |
|---|---|---|---|
| 2 | -2 | 0 | 3 |
| 3 | 4 | -5 | 1 |
| 4 | 0.5 | 2 | -1.5 |
Put the result-row indices 1,2,3 in F2:F4, and the result-column indices 1,2,3 in G6:I6. Label G1:I1 Square 1, Square 2 and Square 3. In G2 enter:
=INDEX(MAP($B$2:$D$4,LAMBDA(reading,reading^2)),$F2,G$6)
Fill G2 across through I2, then fill G2:I2 down through row 4. The input range stays anchored. The index column stays F, and the index row stays 6, while the requested position changes in each output cell.
| Output row | G | H | I |
|---|---|---|---|
| 2 | 4 | 0 | 9 |
| 3 | 16 | 25 | 1 |
| 4 | 0.25 | 4 | 2.25 |
The INDEX reference allows an array returned by another function. Row and column indices refer to positions within that returned array: I4 selects position three, three, corresponding to D4, not worksheet row four and column nine.
Check the mapping and its total
Put descriptive labels in J2:J5 and these formulas in K2:K5:
| Cell | Formula | Expected result |
|---|---|---|
| K2 | =SUM(B2:D4) |
2 |
| K3 | =SUM(G2:I4) |
61.5 |
| K4 | =SUM(B2:D4)^2 |
4 |
| K5 | =K3-K4 |
57.5 |
The sum of the nine squares differs from the square of their sum. Squaring before addition removes signs from each separate term; adding first permits positive and negative inputs to cancel. If the original readings have a measurement unit, their squares have that unit squared.
For direct cell checks, put =B2^2 in K7 for 4, and =D4^2 in K8 for 2.25. These match G2 and I4. They help catch an incorrect selected range or result index.
Advanced: replacing negative values changes the data
Copy MatrixMap to ClippedMap, leaving B2:D4 unchanged. On the copy, change G2 to:
=INDEX(MAP($B$2:$D$4,LAMBDA(reading,IF(reading<0,0,reading))),$F2,G$6)
Fill across through I2, then down through row 4. Rename G1:I1 Clipped 1, Clipped 2 and Clipped 3. The result grid is:
| Output row | G | H | I |
|---|---|---|---|
| 2 | 0 | 0 | 3 |
| 3 | 4 | 0 | 1 |
| 4 | 0.5 | 2 | 0 |
Keep K2 as the raw total 2 and K3 as the mapped total 10.5. Change J3 to Clipped total, J4 to Increase versus raw, and K4 to =K3-K2 for 8.5. Clear J5:K5 and K7:K8 on this copy, because those checks belonged to the square calculation.
The removed negative amounts were -2, -5 and -1.5. Their combined magnitude is 8.5, explaining the increase. This transformation is appropriate only when the problem actually calls for clipping negatives; it is not a general repair for bad measurements or missing data. The original MatrixMap still contains its square results.
Reconstruct Apple’s square example
Create VendorMap, with nine columns A:I and five rows, using no header row. Enter 1,2,3 in A1:C1 and 4,5,6 in A2:C2. Put indices 1,2 in E1:E2 and 1,2,3 in F4:H4.
In F1 enter =INDEX(MAP($A$1:$C$2,LAMBDA(value,value^2)),$E1,F$4), fill through H1, then fill F1:H1 down to row 2. Expect 1,4,9 in F1:H1 and 16,25,36 in F2:H2, matching Apple’s array. Their sum is 91, which =SUM(F1:H2) in I4 checks.
Array entry and practical limits
Apple documents the spilled-range operator # for referring to an array produced by a formula. Scalar INDEX extraction here gives every result an explicit destination; the layout has not been tested as a native spill operation.
The LAMBDA entry restricts definitions to their own cell and says LAMBDA functions cannot be nested. Each formula above contains one local LAMBDA. Copying it does not create a workbook-wide named function.
Mixed text, blank references, error cells, mismatched arrays, multiple results per input and exact invalid-argument errors are outside these numeric examples. The page does not establish all those rules. Keep input and output cells separate and retain the complete result grid when checking totals.
English examples use decimal points and commas. Apple’s functions overview specifies semicolon argument separators when the decimal separator is a comma.
BYROW summarizes rows; BYCOL summarizes columns. LAMBDA, INDEX, IF and SUM explain the building blocks used here.