# BYROW function in Excel

> BYROW runs a LAMBDA on each row of a range and returns one result per row, all from one spilling formula.

Source: https://spreadsheetpractice.com/functions/byrow · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on October 30, 2026

## Quick answer

- **What it does:** BYROW runs a LAMBDA on each row of a range and returns one result per row, all from one spilling formula.
- **Syntax:** `=BYROW(array, lambda)`
- **Most common use:** `=BYROW(B2:D4,LAMBDA(r,SUM(r)))` returns 36 (Each rep's total)
- **Available in:** Excel 2024 and Microsoft 365
- **Category:** [Dynamic array functions](https://spreadsheetpractice.com/functions/category/dynamic-arrays)
- **Returns:** A one-column array with one result per row.
- **Google Sheets:** Available in Google Sheets.

## What it does

BYROW runs a LAMBDA on each row of a range and returns one result per row, all from one spilling formula. Use it for row totals, row maximums or any per-row test where you would otherwise fill a formula down, and with functions like SUM that on their own would collapse the whole range into one number.

## Syntax

`=BYROW(array, lambda)`

| Argument | Required? | What it is |
|---|---|---|
| `array` | Required | The range or array to process row by row. |
| `lambda` | Required | A LAMBDA with one input, the row, that returns a single value. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| E2 | `=BYROW(B2:D4,LAMBDA(r,SUM(r)))` | 36 (spills 3 × 1) | Each rep's total |
| F2 | `=BYROW(B2:D4,LAMBDA(r,MAX(r)))` | 15 (spills 3 × 1) | Each rep's best month |
| H2 | `=SUM(BYROW(B2:D4,LAMBDA(r,MIN(r))))` | 24 | The worst months, added up |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| 1 | Rep | Jan | Feb | Mar | Result |  |  |  |
| 2 | Ana | 12 | 15 | 9 | 36 | 15 |  | 24 |
| 3 | Raj | 8 | 11 | 14 | 33 | 14 |  |  |
| 4 | Lee | 20 | 7 | 13 | 40 | 20 |  |  |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| #CALC! | The LAMBDA returns more than one value per row, such as the row itself. Make it return one number or text. |
| #VALUE! | The second argument isn't a LAMBDA with exactly one input. |

## Tips

- =BYROW(B2:M20,LAMBDA(r,COUNTIF(r,">0"))) counts the months with sales for each row in one formula.

## Related functions

- [BYCOL](https://spreadsheetpractice.com/functions/bycol): BYCOL runs a LAMBDA on each column of a range and returns one result per column, in a single formula that spills across.
- [MAP](https://spreadsheetpractice.com/functions/map): MAP runs a LAMBDA on each value of an array, or on matching values from several arrays, and returns an array of the same size.
- [LAMBDA](https://spreadsheetpractice.com/functions/lambda): LAMBDA creates your own function from a formula: name the inputs, then write the calculation, as in LAMBDA(price, rate, price*(1+rate)).

## Questions

### How do I sum each row with one formula in Excel?

=BYROW(B2:D10,LAMBDA(r,SUM(r))) spills a total for every row.

### Why not just fill down =SUM(B2:D2)?

That works too. BYROW keeps the whole column as one formula, so it grows with a spilled range and can't be overwritten row by row.

## Practice

A graded BYROW exercise ("Best month per rep") is on [the BYROW page](https://spreadsheetpractice.com/functions/byrow). It is checked instantly, then re-checked on changed data.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
