Syntax
| Parameter | Description |
|---|---|
| array | Parameter of the BYROW function. |
| lambda | Parameter of the BYROW function. |
Examples
Sum each row
=BYROW(A1:D10, LAMBDA(row, SUM(row)))
Max minus min per row
=BYROW(B2:F20, LAMBDA(r, MAX(r)-MIN(r)))
Count non-blank cells per row
=BYROW(A1:E50, LAMBDA(r, COUNTA(r)))
Common Errors
The LAMBDA doesn't accept exactly 1 parameter, or it returns more than one value (BYROW expects a single result per row).
The LAMBDA produces an error for one or more rows.
Tips
Your LAMBDA function must reduce each row to one value (a number, text, etc.). If it returns an array, you get a #VALUE! error.
BYROW iterates over rows and returns a column; BYCOL iterates over columns and returns a row. Choose based on the axis of aggregation.
Use BYROW for logic that considers multiple columns together: =BYROW(data, LAMBDA(r, IF(INDEX(r,1)>INDEX(r,2), "Over", "Under"))) compares columns within each row.
Try BYROW in Viztab
Import your data and use BYROW with 370+ other formulas. No signup required.
Open Viztab