Google Sheets BYROW: Calculate Row Summaries Across Multiple Columns
BYROW evaluates a 2D range row by row, passing each horizontal row array to a LAMBDA function and returning a single vertical column of calculated summary values.
=BYROW(array, LAMBDA(row, expression))Technical Overview & Engine Mechanics
Formula Comparison: BYROW vs. Alternatives
Formula Parameters & Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
| array | Range | Required | The 2D table range (e.g. Q1_Sales!B2:E100). |
| LAMBDA | Function | Required | Lambda expression receiving each individual row. |
Real-World Spreadsheet Examples
Explore verified operational formulas used in enterprise reporting and database workflows:
Example 1: Calculate Sum Across 4 Quarters for Every Row
=BYROW(B2:E100, LAMBDA(r, SUM(r)))Example 2: Count Missing Mandatory Cells per Customer Row
=BYROW(A2:H100, LAMBDA(r, COUNTBLANK(r)))Example 3: Determine Highest Performing Product per Salesperson
=BYROW(B2:M50, LAMBDA(r, MAX(r)))Example 4: Row-by-Row Sum Across Multiple Quarter Columns
=BYROW(B2:E1000, LAMBDA(row, IF(COUNTA(row)=0, "", SUM(row))))Example 5: Automated Row Status Evaluator
=BYROW(A2:D500, LAMBDA(r, IF(INDEX(r, 1, 4) < TODAY(), "Expired", "Active")))Common Errors & Solutions
Performance Pro Tips
- Pair BYROW with `BYCOL` when you need column totals instead of row totals.
Frequently Asked Questions: BYROW
Why use BYROW instead of ARRAYFORMULA?
Functions like SUM, AVERAGE, and COUNT aggregate all inputs into one number inside ARRAYFORMULA. BYROW calculates them row-by-row.
How do I access individual columns inside a BYROW lambda?
Use INDEX: INDEX(row, 1, 1) refers to column 1; INDEX(row, 1, 3) refers to column 3.
What is the sister function for columns?
BYCOL operates identically to BYROW, but processes column-by-column across horizontal matrices.
Can I nest LET inside a BYROW LAMBDA?
Yes! Combining BYROW with LAMBDA and LET is the cleanest architecture for complex row-by-row enterprise calculations.
Does BYROW work with empty trailing rows?
Always check for empty rows: LAMBDA(r, IF(COUNTA(r)=0, "", your_calculation)) to prevent cluttering empty rows.
Related Google Sheets Formulas
LAMBDA
LAMBDA allows users to author custom, reusable functions directly inside standard spreadsheet cells using native formulas, eliminating the need to write custom JavaScript in Google Apps Script.
Logic & Modern LambdasLET
LET assigns names to calculation results inside a formula. This stops Google Sheets from calculating the same sub-expression multiple times, boosting calculation performance by up to 500% and making long nested formulas easy to read.
Logic & Modern LambdasMAP
MAP applies a custom LAMBDA function to every element in one or more arrays, producing an array of transformed results. Unlike ARRAYFORMULA, MAP works with functions like AND, OR, and complex custom logic.