FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

BYROW in Google Sheets

BYROW passes each row of a range to your LAMBDA in Google Sheets and returns one value per row.

Syntax (same in Google Sheets)

BYROW(array, LAMBDA(row))

MAP and BYCOL cover the element-wise and column-wise cases.

For a fuller explanation of the arguments and common errors, see the BYROW Excel guide.

Worked examples in Google Sheets

Row totals

ABC
1Q1Q2Q3
210205
3739

Formula: E2: =BYROW(A2:C3,LAMBDA(r,SUM(r)))

Result: Spills down: 35, 19

The first row adds up to 35 and the second to 19.

Spread per row

ABC
1Q1Q2Q3
210205
3739

Formula: E2: =BYROW(A2:C3,LAMBDA(r,MAX(r)-MIN(r)))

Result: Spills down: 15, 6

Row one spans 5 to 20, which is 15; row two spans 3 to 9, which is 6.

Count above a limit

ABC
1Q1Q2Q3
210205
3739

Formula: E2: =BYROW(A2:C3,LAMBDA(r,SUM(--(r>6))))

Result: Spills down: 2, 2

The comparison creates TRUE and FALSE values, the double minus turns them into 1 and 0, and SUM counts them.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =BYROW(C2:D4,LAMBDA(r,SUM(r)))

Example spreadsheet for BYROW
ABCDEF
1RegionProductUnitsPriceResult
2EastPen1202.5122.5
3WestPen802.582.5
4EastBook451257
5NorthBook6012
6WestLamp3025
7EastLamp1525
Result in F2: 122.5
Practice this in a lesson: LAMBDA, MAP, REDUCE, BYROW

Frequently asked questions

How do I total each row of a range with one formula in Google Sheets?
Use BYROW(range, LAMBDA(r, SUM(r))). The row totals spill downward from the formula cell.

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.