ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to sum every 2nd or 3rd row (https://www.excelbanter.com/excel-worksheet-functions/184110-how-sum-every-2nd-3rd-row.html)

Mario[_3_]

How to sum every 2nd or 3rd row
 
How to sum every 2nd or 3rd row on the easiest way?



Mike H

How to sum every 2nd or 3rd row
 
Hi,

Try this

=SUM(IF(MOD(ROW($A$1:$A$100),3)=0,$A$1:$A$100,0))
It's an arry so commit with
Ctrl+Shift+Enter

Change the 3 to a 2 to do every second row

Mike

"Mario" wrote:

How to sum every 2nd or 3rd row on the easiest way?




ryguy7272

How to sum every 2nd or 3rd row
 
Summing to any Nth value is quite easy in Excel:
http://www.mcgimpsey.com/excel/formu...meverynth.html

Also, from he
http://www.cpearson.com/excel/excelf.htm
Summing Every Nth Value

You can easily sum (or average) every Nth cell in a column range. For
example, suppose you want to sum every 3rd cell.

Suppose your data is in A1:A20, and N = 3 is in D1. The following array
formula will sum the values in A3, A6, A9, etc.

=SUM(IF(MOD(ROW($A$1:$A$20),$D$1)=0,$A$1:$A$20,0))

If you want to sum the values in A1, A4, A7, etc., use the following array
formula:

=SUM(IF(MOD(ROW($A$1:$A$20)-1,$D$1)=0,$A$1:$A$20,0))

If your data ranges does not begin in row 1, the formulas are slightly more
complicated. Suppose our data is in B3:B22, and N = 3 is in D1. To sum the
values in rows 5, 8, 11, etc, use the following array formula:

=SUM(IF(MOD(ROW($B$3:$B$22)-ROW($B$3)+1,$D$1)=0,$B$3:B$22,0))

If you want to sum the values in rows 3, 6, 9, etc, use the following array
formula:

=SUM(IF(MOD(ROW($B$3:$B$22)-ROW($B$3),$D$1)=0,$B$3:B$22,0))

Download a workbook illustrating these formulas.

Regards,
Ryan--

--
RyGuy


"Mike H" wrote:

Hi,

Try this

=SUM(IF(MOD(ROW($A$1:$A$100),3)=0,$A$1:$A$100,0))
It's an arry so commit with
Ctrl+Shift+Enter

Change the 3 to a 2 to do every second row

Mike

"Mario" wrote:

How to sum every 2nd or 3rd row on the easiest way?





All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com