Odd and even numbers

R

RodJ

I need a function that would count how many are odd/even numbers in a row or
column.
eg:
1,3,6,22,35 = this row has 3 odd and 2 even numbers. Is there a function
that can count this for me.

Thanks
RodJ
 
P

Peo Sjoblom

For even numbers

=SUMPRODUCT(--(MOD(A1:J1,2)=0),--(ISNUMBER(A1:J1)))


for odd


=SUMPRODUCT(--(MOD(A1:J1,2)=1),--(ISNUMBER(A1:J1)))



--


Regards,


Peo Sjoblom
 
R

RodJ

Thanks Peo, i just tried your suggestion and did not work. Do I have to key
in _ _ between brackets?

Thanks heaps
 
R

RodJ

Thanks so much...it did work after i used --.
Wonderful . i really appreciate this....wow...what a great community...
 
T

Teethless mama

=SUMPRODUCT(--(MOD(A1:J1,2)=0),--(ISNUMBER(A1:J1)))

the "--ISNUMBER (A1:J1)" in your formula won't do any good. If one of the
cell contain text value, your formula still returns #VALUE! error.


The *array* formula below ignore any text value

=SUM(IF(ISNUMBER(A1:J1),IF(MOD(A1:J1,2)=1,1)))

*ctrl+shift+enter*, not just enter
 
P

Peo Sjoblom

It will not count blank cells, that was the reason not to avoid text, or
else they will be counted as even (0)

--


Regards,


Peo Sjoblom
 

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