BYROW in Google Sheets, One Result Per Row
By Szabó Gergő · Updated
BYROW walks a range and returns one value per row. Pair it with LAMBDA. Excel 365 has the same idea.
Syntax and arguments
=BYROW(array_or_range, LAMBDA)- array_or_range
- Rows to walk.
- LAMBDA
- Function that receives one row and returns one value.
BYROW examples
01
Row totals
Numbers in B2:D10.
=BYROW(B2:D10, LAMBDA(r, SUM(r)))Sums each row in B:D.
02
Paid flag
Status in C2:C.
=BYROW(C2:C, LAMBDA(s, IF(s="Paid","Yes","No")))Maps a status column without dragging.
03
Skip blanks
Text in A2:A.
=BYROW(A2:A, LAMBDA(v, IF(v="","",LEN(v))))Returns length only when the cell has text.
Common mistakes
Returning a spilled row from the LAMBDA
Each call should return one value. Use another shape for matrices.
Using BYROW for cell-wise math
ARRAYFORMULA is simpler for A2:A*B2:B.
Forgetting LAMBDA
The second argument is a function, not a SUM range.
BYROW FAQ
BYROW or ARRAYFORMULA?
ARRAYFORMULA is simpler for cell-wise math. BYROW wins when the logic needs the whole row.
Can BYROW return two columns?
Each LAMBDA call should return one value. Use BYCOL or a different shape for matrices.
Does Excel have BYROW?
Excel 365 has BYROW. The LAMBDA syntax is the same idea.