How to sum every n rows down in Excel?
Supposing you have a long list of data in your worksheet, and you need to sum every next 5 rows down like this: =SUM(B2:B6), =SUM(B7:B11) and so on, and then put the result in another column as following screenshot shown. In this article, I will talk about some good formulas for you to solve this problem.
In this example, I will sum every 5 rows of the data, please apply the following formula:
1. Enter this formula into a blank cell where you want to put the result: =SUM(OFFSET($B$2,(ROW()-ROW($B$2))*5,0,5,1))
Tip: In the above formula, B2 indicates the started row number you want to sum, and 5 stands for the incremental row numbers. If you want to sum every 10 rows in column B, you just need to change 5 to 10.
2. Then drag the fill handle over to the cells until 0 is displayed. And you will get the results you need. See screenshot:
1. Sometimes, you would like the results of every 5 rows’ total values displayed at the last line in column C as following screenshot shown:
In this case, please enter this formula: =IF(MOD(ROW(),5),"",SUM(OFFSET(B1,,,-5))) (B1 is the first cell value which you want to sum in column B, and 5 is the incremental row numbers) into cell C1, and then drag the fill handle to the cells that you want to apply this formula.
Tip: the above formula can be applied successfully if your data begins at the first cell.
2. If you have a list of values in a row, you can also use a formula to sum every n columns, =SUM(OFFSET($A$1,,(COLUMNS($A$3:A3)-1)*5,,5)) (A1 is the cell reference which your first value located, A3 stands for the cell where you put this formula in, and 5 is the incremental column numbers ), and then drag the fill handle over to the right cells until 0 is displayed, see screenshots:
If you have Kutools for Excel, you can insert some page breaks every n rows, and then calculate the paging subtotals to get the result.
|Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.|
After installing Kutools for Excel, please do as follows:
1. Click Kutools Plus > Printing > Insert Page Break Every Row, see screenshot:
2. In the Insert Page Break Every Row dialog box, specify the interval of rows which you want to insert the page breaks, and the page breaks have been inserted into the data every 5 rows, see screenshot:
3. And then click Kutools Plus > Printing > Paging Subtotals, see screenshot:
4. In the Paging Subtotals dialog box, check the column header that you want to do some calculations, and choose the function you need, see screenshot:
5. Then click Ok, all every 5 rows data have been summed up, see screenshot: