COUNTIF statement

mdorman

New Member
Joined
Jan 27, 2005
Messages
23
Is there any way to do a COUNTIF statement with two criteria?

For example:

COUNTIF(AND(X>5,X<10))

I tried using the above COUNTIF(AND statement, but it didn't work.

Any ideas would be greatly appreciated.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
mdorman said:
Is there any way to do a COUNTIF statement with two criteria?

For example:

COUNTIF(AND(X>5,X<10))

I tried using the above COUNTIF(AND statement, but it didn't work.

Any ideas would be greatly appreciated.

COUNTIF(Range,">5")-countif(Range,">10")
 
Upvote 0
You could use
=COUNTIF(A1:A10,">5")-COUNTIF(A1:A10,">=10")
or
=SUMPRODUCT(COUNTIF(A1:A10,{">5",">=10"}),{1,-1})
with an array constant
 
Upvote 0
Please if you want to include numbers in between 5 and 10 (but excluding them) to use one of the formulations I suggested. Due to a subtle difference Just jon's will include 10s
 
Upvote 0

Forum statistics

Threads
1,203,066
Messages
6,053,330
Members
444,654
Latest member
Rich Cohen

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