How to sum every N rows in Excel (groups of rows)
Formula (Excel and Google Sheets)
=SUMPRODUCT((INT((ROW($B$2:$B$16)-ROW($B$2))/$E$1)=D3-1)*$B$2:$B$16)Number the blocks with INT and add the rows in each: =SUMPRODUCT((INT((ROW($B$2:$B$16)-ROW($B$2))/$E$1)=D3-1)*$B$2:$B$16).
- Result on the example
- one result per row in
E3, filled down toE5 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in E3, filled down to E5. Change any input and the result updates, or edit the formula to experiment.
How it works
ROW(…)-ROW($B$2) numbers the rows 0 to 14, and dividing by 5 with INT turns that into block numbers: 0 for the first five rows, 1 for the next five, 2 for the last. Each summary row keeps the block equal to its week minus 1 and adds those calls. Change E1 to group by any size.
=SUMPRODUCT((INT((ROW($B$2:$B$16)-ROW($B$2))/$E$1)=D3-1)*$B$2:$B$16)Result233
$B$2:$B$1615 rows × 1 col: 42, 38, 51, 47, …A range: 15 cells in one column.
ROW($B$2:$B$16){15 rows × 1 col} 2, 3, 4, 5, …ROW: Row number of a reference, or of this cell.- reference
$B$2:$B$1615 rows × 1 col: 42, 38, 51, 47, …
- reference
$B$242The value in B2.
ROW($B$2)2ROW: Row number of a reference, or of this cell.- reference
$B$242
- reference
ROW($B$2:$B$16)-ROW($B$2){15 rows × 1 col} 0, 1, 2, 3, …The - operator subtracts.
$E$15The value in E1.
ROW($B$2:$B$16)-ROW($B$2))/$E$1{15 rows × 1 col} 0, 0.2, 0.4, 0.6, …The / operator divides.
INT((ROW($B$2:$B$16)-ROW($B$2))/$E$1){15 rows × 1 col} 0, 0, 0, 0, …INT: Rounds down to the nearest integer.- number
ROW($B$2:$B$16)-ROW($B$2))/$E$1{15 rows × 1 col} 0, 0.2, 0.4, 0.6, …
- number
D31The value in D3.
D3-10The - operator subtracts.
INT((ROW($B$2:$B$16)-ROW($B$2))/$E$1)=D3-1{15 rows × 1 col} TRUE, TRUE, TRUE, TRUE, …The = operator tests whether the two sides are equal.
INT((ROW($B$2:$B$16)-ROW($B$2))/$E$1)=D3-1)*$B$2:$B$16{15 rows × 1 col} 42, 38, 51, 47, …The * operator multiplies.
SUMPRODUCT((INT((ROW($B$2:$B$16)-ROW($B$2))/$E$1)=D3-1)*$B$2:$B$16)233SUMPRODUCT: Multiplies arrays row by row and adds the results.- array1
INT((ROW($B$2:$B$16)-ROW($B$2))/$E$1)=D3-1)*$B$2:$B$16{15 rows × 1 col} 42, 38, 51, 47, …
- array1
In Google Sheets
The same formula works in Google Sheets: =SUMPRODUCT((INT((ROW($B$2:$B$16)-ROW($B$2))/$E$1)=D3-1)*$B$2:$B$16). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =SUM(TAKE(DROP($B$2:$B$16,(D3-1)*$E$1),$E$1))Excel only | 233, 244, 237 | Excel 365: skip the earlier blocks with DROP, keep the next block with TAKE. |
| =SUM(CHOOSEROWS($B$2:$B$16,SEQUENCE($E$1,1,(D3-1)*$E$1+1))) | 233, 244, 237 | Excel 365 and Google Sheets: CHOOSEROWS picks the rows of the block by position. |
Common mistakes
- This counts rows, not dates. If a day is missing, every later week shifts. With real dates, sum by week with SUMIFS instead.
- Every block must be the same size. A partial last block is summed as a smaller group.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Sum every N rows in Excel (groups of rows)
E3, total the calls for week D3, where each week is a block of E1 rows, then fill down to E5.Questions
How do I put the block total on the last row of each block instead?
In Excel 365, fill =IF(MOD(ROWS($B$2:B2),$E$1)=0,SUM(TAKE($B$2:B2,-$E$1)),"") down next to the data: every fifth row shows the total of the five rows ending there.
How do I sum every nth row instead of blocks?
Use MOD on the position: =SUMPRODUCT((MOD(ROW(B2:B16)-ROW(B2)+1,5)=0)*B2:B16) adds rows 5, 10 and 15.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.