Numbers BYROW: Row Totals, Maxima and LAMBDA Examples
Apply a LAMBDA to each Numbers array row, extract results with INDEX and check totals, ranges and shifted inputs with complete tables.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
BYROW applies a LAMBDA calculation to each row of an array and returns the row results. For a row containing 4,6,8, a sum calculation returns 18; a maximum calculation returns 8. The choice of calculation belongs inside LAMBDA.
The following worksheet extracts each result with INDEX, keeping row labels and input measurements intact.
Availability and version history
- Introduced: The original introduction release and date are not established by the checked references. LAMBDA’s separate release history 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 BYROW reference. Examples were independently calculated; no native Numbers test was performed.
Syntax: the parameter represents one row
BYROW(array, LAMBDA(parameter, calculation))
The array and LAMBDA calculation are required. The parameter identifies the row passed to the subformula; the required calculation goes last inside LAMBDA. Apple’s BYROW entry demonstrates row maxima and a row-level SUMPRODUCT expression.
Use a row-oriented parameter name such as samples to make its role clear. In LAMBDA(samples,SUM(samples)), SUM receives the current row, not the whole input matrix. The function has no documented optional direction or rounding mode.
Build four three-reading batches
Create BatchReadings, with twelve columns A:L and nine rows, including one header row. Enter Batch in A1 and Reading 1, Reading 2 and Reading 3 in B1:D1. Put the following inputs in A2:D5. All readings use the same unit.
| Row | A: Batch | B | C | D |
|---|---|---|---|---|
| 2 | Alpha | 4 | 6 | 8 |
| 3 | Beta | 0 | 9 | 3 |
| 4 | Gamma | 12 | 12 | 6 |
| 5 | Delta | -2 | 5 | 9 |
Put 1,2,3,4 in F2:F5. These are indices within the returned result, not the worksheet’s row numbers. In G2 enter:
=INDEX(BYROW($B$2:$D$5,LAMBDA(samples,SUM(samples))),F2,1)
Fill G2 through G5. The anchored input stays B2:D5, while F supplies the next result position. Expect 18,12,30,12.
In H2 enter =SUM(B2:D2) and fill through H5 for the same row totals. In I2 enter =G2-H2 and fill through I5 for mathematical zeros. These direct controls make it easier to detect an index or selected-range mistake.
The INDEX reference explicitly allows an array returned by another function as its first argument. Here the row result is selected with its index and column one, giving each scalar a specific destination.
Change the row calculation without changing the input
In J2 enter =INDEX(BYROW($B$2:$D$5,LAMBDA(samples,MAX(samples))),F2,1) and fill through J5. In K2 use the same formula with MIN instead of MAX, then fill through K5.
In L2 enter =INDEX(BYROW($B$2:$D$5,LAMBDA(samples,MAX(samples)-MIN(samples))),F2,1) and fill through L5.
| Row | G: Sum | J: Maximum | K: Minimum | L: Range |
|---|---|---|---|---|
| 2 | 18 | 8 | 4 | 4 |
| 3 | 12 | 9 | 0 | 9 |
| 4 | 30 | 12 | 6 | 6 |
| 5 | 12 | 9 | -2 | 11 |
Gamma has the largest total, but Delta has the largest within-row range. A row summary must match the question: sum measures a total, while maximum minus minimum measures the span of the readings.
In F7 enter =SUM(G2:G5) and in F8 enter =SUM(B2:D5); both give 72. Their agreement checks that every numeric input is included once in the row-total calculation. It does not establish that the underlying measurements are complete or accurate.
Advanced: a constant offset changes sums but preserves ranges
Copy BatchReadings to OffsetReadings. On the copy, replace only B2:D5 with the following values, each ten above its corresponding original value:
| Row | B | C | D |
|---|---|---|---|
| 2 | 14 | 16 | 18 |
| 3 | 10 | 19 | 13 |
| 4 | 22 | 22 | 16 |
| 5 | 8 | 15 | 19 |
The copied G:H totals become 48,42,60,42; I remains zero. J maxima become 18,19,22,19, and K minima become 14,10,16,8. L ranges remain 4,9,6,11. F7 and F8 both become 192.
Each three-reading row gains thirty in total. Its maximum and minimum both gain ten, so their difference stays unchanged. This is a mathematical offset example, not a calibration recommendation. Keep the source table separate so changing inputs does not invalidate its expected results.
Reconstruct Apple’s row illustration
Create VendorRows, with six columns A:F and five rows, and use no header row for this grid. Enter 3,4,1 in A1:C1, 6,7,9 in A2:C2 and 2,5,8 in A3:C3. Put indices 1,2,3 in D1:D3.
In E1 enter =INDEX(BYROW($A$1:$C$3,LAMBDA(samples,MAX(samples))),D1,1) and fill through E3 for 4,9,8, matching Apple’s row maxima. In F1 use =SUM(A1:C1) and fill through F3 for the row sums 8,22,15. A result should not overwrite a cell in A1:C3.
Array entry, references and limits
Apple documents the spilled-range operator # for referencing an array produced by a formula. This guide uses scalar INDEX extraction instead, so each result cell has an explicit formula and destination. That is not a native spill-layout test or a claim that spilling is unavailable.
The LAMBDA reference says definitions are local to their cell and LAMBDA functions cannot be nested. Each formula here contains one LAMBDA, supplied to the outer row or column function. Copying the formula copies that local definition; it does not create a workbook-wide named function.
The fixtures use numbers with compatible units. The short helper entry does not establish every mixed-type array, empty range, error cell, multi-result calculation or extreme numerical limit. Exact malformed-parameter errors and cross-client workbook behavior remain unverified. Keep the inputs and output cells separate.
English examples use decimal points and commas. Apple’s functions overview specifies semicolon argument separators where the decimal separator is a comma. For another table, select the intended cells while editing so Numbers inserts the qualified reference, such as TableName::B2.
BYCOL summarizes columns instead. LAMBDA defines the calculation, and INDEX selects its result. SUM, MAX and MIN supply the numeric summaries used here.