SUM odd/even Rows?

T

TexJen

Is there a way to select a range, and then SUM only the odd # rows in that
range? Or, even # rows?
thnx so much
 
C

carlo

If you need a formula you could use this:
where A1:A18 is your range
for odd rows:
=SUMPRODUCT((MOD(ROW(A1:A18),2)=1)*(A1:A18))
for even rows
=SUMPRODUCT((MOD(ROW(A1:A18),2)=0)*(A1:A18))

hth
Carlo
 
J

Jim Cone

This one sums the even numbered rows in Column A - rows 31 to 51...
=SUM(IF(MOD(ROW(A31:A51),2)=0,A31:A51))
It is an array formula and must be entered using Ctrl + Shift + Enter
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"TexJen"
wrote in message
Is there a way to select a range, and then SUM only the odd # rows in that
range? Or, even # rows?
thnx so much
 
M

MartinW

Hi Jen,

One way is to extract the odd and even cells to helper columns.

For example put the nimbers 1 to 20 in A1:A20
Then put this in B1
=INDEX(A:A,ROW()*2-1)
And this in C1
=INDEX(A:A,ROW()*2)

Grab the fill handle and drag both formulae down to Row 10.
That will leave all the odd numbers in column B
and all the even numbers in column C

HTH
Martin
 
G

Gord Dibben

Even =SUMPRODUCT((A1:B10)*(MOD(ROW(A1:B10),2)=0))


Odd =SUMPRODUCT((A1:B10)*(MOD(ROW(A1:B10),2)<>0))


Gord Dibben MS Excel MVP
 
A

Alan Beban

TexJen said:
Is there a way to select a range, and then SUM only the odd # rows in that
range? Or, even # rows?
thnx so much
If the functions in the freely downloaded file at
http://home.pacbell.net/beban are available to your workbook

Odd--=SUM(ArrayAlternates(A1:D11))

Even--=SUM(ArrayAlternates(A1:D11,False))

Alan Beban
 

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