Counting Even-Odd Numbers that are Less (or More) than a Certain Value

kioutsoukov

New Member
Joined
Sep 23, 2010
Messages
2
Hello

I have a row that consists of numbers.
I want to count how many numbers in that row are odd, more than 20 and less than 40 in one and single formula!

I would appreciate a respond
Thanks in advance
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hello and welcome to MrExcel

Assuming your numbers are in A2:Z2 you could use this approach

=SUMPRODUCT((A2:Z2>20)*(A2:Z2<40)*(MOD(A2:Z2,2)=1))
 
Upvote 0
Hi,
Welcome to the board!

=SUMPRODUCT(MOD(A1:Z1,2),--(A1:Z1>20),--(A1:Z1<40))
 
Upvote 0
Hello

I have a row that consists of numbers.
I want to count how many numbers in that row are odd, more than 20 and less than 40 in one and single formula!

I would appreciate a respond
Thanks in advance

Let A2:N2 house the number set of interest and let...

A4: 20

B4: 40

C4, control+shift+enter, not just enter:

=SUM(IF(A2:N2>=A4,IF(A2:N2<=B4,1-(MOD(A2:N2,2)=0))))
 
Upvote 0
Assuming integers, MOD(x,2) will generate 1 if it is odd. I don't believe there is any need to do additional math or comparisons on it.
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,937
Members
449,196
Latest member
Maxkapoor

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top