How to sum every 2nd or 3rd row

M

Mike H

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
 
R

ryguy7272

Summing to any Nth value is quite easy in Excel:
http://www.mcgimpsey.com/excel/formulae/sumeverynth.html

Also, from here:
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--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top