# How to sum each row with one formula in Excel

Use BYROW with LAMBDA: =BYROW(B2:F6,LAMBDA(r,SUM(r))) returns one total per row and spills down, so there is nothing to fill.

**Excel:** `=BYROW(B2:F6,LAMBDA(r,SUM(r)))` (Excel 2024 and Microsoft 365)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F | G | H |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Employee | Mon | Tue | Wed | Thu | Fri |  | Hours |
| Priya | 8 | 7.5 | 8 | 8 | 6 |  |  |
| Tom | 8 | 8 | 8 | 9 | 8 |  |  |
| Ines | 6 | 6 | 7 | 6 | 0 |  |  |
| Marcus | 8 | 8.5 | 8 | 8 | 8 |  |  |
| Hana | 7 | 8 | 8 | 8 | 7.5 |  |  |

Formula in H2: `=BYROW(B2:F6,LAMBDA(r,SUM(r)))`

Result (spills 5 × 1): 37.5; 41; 25; 40.5; 38.5

## How it works

`BYROW` hands each row of the range to a LAMBDA as `r`, and whatever the LAMBDA returns becomes that row's result. Swap `SUM` for `MAX`, `AVERAGE` or your own logic. `BYCOL` does the same for columns.

## Common mistakes

- The LAMBDA parameter holds a whole row, so use an aggregate like SUM inside; `r*2` would return a row, not a single value.
- Older Excel versions do not have BYROW, so the cell shows #NAME?.

## Questions

**Why not just fill =SUM(B2:F2) down?**

You can. BYROW is for when you want one formula that resizes itself, or logic that is longer than SUM.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-11-20.

Source: https://spreadsheetpractice.com/formulas/sum-each-row-with-byrow
