BYROW function in Google Sheets
Groups an array by rows by application of a LAMBDA function to each row.
=BYROW(array_or_range, LAMBDA)BYROW syntax and parameters
Two arguments, two required.
- array_or_rangeanyRequired
The array or range to group by rows.
- LAMBDAanyRequired
A LAMBDA that’s applied to each row in the given array or range to obtain its grouped value. Syntax: LAMBDA(name,formula_expression) Requirements: The LAMBDA must have exactly 1 name argument along with a formula_expression which uses that name. The name resolves to the current row being grouped when the LAMBDA is applied.
BYROW examples
Formulas you'll actually reuse.
A yearly total for each product row:
=BYROW(B2:M13, LAMBDA(row, SUM(row)))Flag rows whose best month cleared 10,000:
=BYROW(B2:M13, LAMBDA(row, IF(MAX(row) > 10000, "Peak", "")))
BYROW in Excel
Same name — your formula ports as-is.
Try BYROW in the playground
Edit the example — nothing to install.
Preloaded with the BYROW formula from Example 1 — change anything and watch it respond.
Related functions
More ways Google Sheets gets this done.
- BYCOLGroups an array by columns by application of a LAMBDA function to each column.ArrayExcel
- CHOOSECOLSCreates a new array from the selected columns in the existing range.ArrayExcel
- CHOOSEROWSCreates a new array from the selected rows in the existing range.ArrayExcel
- HSTACKAppends ranges horizontally and in sequence to return a larger array.ArrayExcel
- LINESTGiven partial data about a linear trend, calculates various parameters about the ideal linear trend using the least-squares method.ArrayExcel
- MAKEARRAYReturns an array of specified dimensions with values calculated by application of a LAMBDA function.ArrayExcel