count and return pair numbers

S

Sly

What function can I use to return the number of pair or impair numbers in a
row

A B C D E F

Row 1 2 6 9 11 16 20 Pair number = 4
Impair number = 2

Thanks

Sly
 
M

Mike H

Perhaps odd and even numbers?

=SUM(MOD(A1:A10,2))
=SUM(IF(MOD(A1:A10,2)=0,1,0))

The top formula returns odd number, the other returns even
Both are array formula so Ctrl+Shidt+enter

Mike
 
S

Sly

Sorry I will reformulate

I'm looking to find out how many cell in a row contain an even number

row1 = 2 4 8 11 15 16

Looking for a formula that will tell me (4) cells have even number
 
M

Mike H

Which for a range with no blank cells is exacly what the 2 formula I have
given you will do.

Mike
 
S

Sly

Sorry Mike

Don't want to waste your time but I try it does'nt work

Thank you very much for your time

Sly
 
M

Mike H

If blanks are an issue then use this for even numbers

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

or in fact a similar one for odd numbers but the previous isn't affected by
blanks

=SUMPRODUCT(--(A1:A10<>""),--(MOD(A1:A10,2)=1))

Mike

Mike
 
R

Rick Rothstein \(MVP - VB\)

Try these formulas...

Odd: =SUMPRODUCT(--(MOD(A1:F1,2)=1))

Even: =SUMPRODUCT(--(MOD(A1:F1,2)=0))

Rick
 
T

Teethless mama

Try this:

For Even numbers:
=SUMPRODUCT(--(MOD(A1:F1,2)=0))

For Odd numbers:
=SUMPRODUCT(--(MOD(A1:F1,2)=1))
 
R

Rick Rothstein \(MVP - VB\)

I think the problem is the OP asked for numbers in a row and your formulas
were for numbers in a column... I'm not sure he sees the difference.

Rick
 
R

Rick Rothstein \(MVP - VB\)

Try these formulas...
Odd: =SUMPRODUCT(--(MOD(A1:F1,2)=1))

Even: =SUMPRODUCT(--(MOD(A1:F1,2)=0))

Mike raises a good point about blanks. Here are revisions to the above which
will account for the blanks...

Odd: =SUMPRODUCT((A1:F1<>"")*(MOD(A1:F1,2)=1))

Even: =SUMPRODUCT((A1:F1<>"")*(MOD(A1:F1,2)=0))

Rick
 
S

Sandy Mann

Rick,
Odd: =SUMPRODUCT(--(MOD(A1:F1,2)=1))

You don't need the =1, (--(MOD(A1:F1,2) returns 0 or 1 anyway

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

[email protected]
Replace @mailinator.com with @tiscali.co.uk
 
R

Rick Rothstein \(MVP - VB\)

Good point! Thanks for noting that.

Rick


Sandy Mann said:
Rick,


You don't need the =1, (--(MOD(A1:F1,2) returns 0 or 1 anyway

--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

[email protected]
Replace @mailinator.com with @tiscali.co.uk
 
Top