COUNTIF statement

mdorman

New Member
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")

You could use
=COUNTIF(A1:A10,">5")-COUNTIF(A1:A10,">=10")
or
=SUMPRODUCT(COUNTIF(A1:A10,{">5",">=10"}),{1,-1})
with an array constant

I knew there was a solution.

Thanks a bunch

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

Replies
4
Views
132
Replies
3
Views
109
Replies
4
Views
338
Replies
3
Views
260
Replies
3
Views
96

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.

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

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