Problem with COUNTIF

hallingh

Well-known Member
Joined
Sep 11, 2010
Messages
769
OK, I need to get together a countif formula that only counts if BOTH specified criteria are true... This is what I thought would work:

Code:
=COUNTIF(W1:W28, AND(>A18, <A19))

But it is not letting me enter that into the cell...

Anyone have any ideas?

Any help is greatly appreciated...

Thanks!

Hank
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
OK, I need to get together a countif formula that only counts if BOTH specified criteria are true... This is what I thought would work:


Code:
=COUNTIF(W1:W28, AND(>A18, <A19))[ p CODE]<> 
But it is not letting me enter that into the cell...
 
Anyone have any ideas?
 
Any help is greatly appreciated...
 
Thanks!
 
Hank[/QUOTE]
 
Care to explain the problem in words?
 
Upvote 0
I have a range (W1:W28) that contains the formula:

Code:
=RAND() * 6

In Cell F1, I want it to count how many times there is a number between the value in cell A18 and cell A19.

Ah! Just realized the formula got cut off! It is actually:

Code:
=COUNTIF(W1:W28, AND(<A18, >A19))

THanks for the reply!

Sorry for the confusion.

Hank
 
Upvote 0
=COUNTIF(W1:W28, AND( >A18, < A19))

If you have Excel 2007 or later try COUNTIFS

=COUNTIFS(W$1:W$28,">"&A18,W$1:W$28,"<"&A19)

or in earlier versions you can use two COUNTIF functions for the same result

=COUNTIF(W$1:W$28,">"&A18)-COUNTIF(W$1:W$28,">="&A19)

Note that "<"&A19 changes to the opposite in the second, ">="&A19 because you are subtracting
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,429
Members
452,914
Latest member
echoix

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