View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default COUNTIF....how to use =0 but <9 as CRITERIA

Hi,

If you want to use countif you use 2 of them like this

=COUNTIF(A1:A34,"=0")-COUNTIF(A1:A34,"9")

The first counts everything = to your lower number and the second subtracts
everything larger than your largest.
Mike

"Jay" wrote:

I cannot figure out how to use two criteria with the COUNTIF function. Here
is what
I need to accomplish:

I have a list of 2000 numbers in column A, the numbers are between 0 and
99(inclusive).

I want to see how many numbers are in the following ranges:
1. greater than or equal to 0, less than 9
2. greater than or equal to 10, less than 19
3. greater than or equal to 20, less than 29
.
.
.
.
.
.
9.greater than or equal to 90, less than 99



Using the COUNTIF function how do you nest =0 but <9 to achieve the results
for my first range?


I have tried the following two versions of the function to no avail:

=COUNTIF(A1:A2000,"=0,<9")

=COUNTIF(A1:A2000,"AND(=0,<9)")


Does the COUNTIF function only allow one variable as the criteria??

Any suggestions or a solution would be appreciated.

THANKS