How do I get the sum of only odd/even numbered cells in a column?

G

Guest

I need help with the formula to sum up only the odd or even numbers in a
column. I appreciate any help that you can provide.

Thanks,
Steve
 
P

Peo Sjoblom

One way,

even

=SUMPRODUCT(--(MOD(A1:A10,2)=0),A1:A10)

odd

=SUMPRODUCT(--(MOD(A1:A10,2)=1),A1:A10)
 
B

Bob Phillips

=SUM(IF(MOD(A1:A100,2)=0,A1:A100))

for even numbers, and

=SUM(IF(MOD(A1:A100,2)=1,A1:A100))

for odd numbers.

These are array formulae, so commit with Ctrl-Shift-Enter.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
R

Ron Rosenfeld

On Thu, 3 Mar 2005 06:37:09 -0800, "Steve E" <Steve
I need help with the formula to sum up only the odd or even numbers in a
column. I appreciate any help that you can provide.

Thanks,
Steve

Odd: =SUMPRODUCT(MOD(A1:A25,2)*A1:A25)
Even: =SUM(A1:A25,-SUMPRODUCT(MOD(A1:A25,2)*A1:A25))


--ron
 

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