Summing every other row

jcg

Board Regular
Joined
Jul 12, 2002
Messages
156
I have 235 row the odd rows representing numbers from 2006 the even rows representing numbers from 2007. Is there a way to "sumif" based upon the row being either odd or even?
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Seti

Well-known Member
Joined
May 19, 2002
Messages
2,916
For the odd rows:

=SUMPRODUCT($B$3:$B$26,--(1=MOD(ROW($B$3:$B$26),2)))

and for the even rows:

=SUMPRODUCT($B$3:$B$26,--(0=MOD(ROW($B$3:$B$26),2)))

assuming your data is in B3:B26. Adjust to suit the ranges.
 

S.H.A.D.O.

Well-known Member
Joined
Sep 6, 2005
Messages
1,915
Hi jcg,

An Alternative Solution could be :-

For the Even Rows ...

=SUM(IF(MOD(ROW(B2:B100),2)=0,B2:B100))

... and for the Odd Rows ...

=SUM(IF(MOD(ROW(B2:B100),2)=1,B2:B100))

Assuming your Data is in Cells B2:B100. Adjust to Suit your Ranges. Both Formulas should be Array Entered ( Ctrl+Shift+Enter ).

Hope this Helps.
All the Best.
SHADO
 

Watch MrExcel Video

Forum statistics

Threads
1,113,795
Messages
5,544,337
Members
410,603
Latest member
rseckler
Top