View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default countif functions

But it is subtracting greater than or equal to 20 from greater than or equal
to 10 which is correct, the error must be between the chair and the
computer, to show what I mean
assume these are the 12 values and they are in A1:A12
1
2
3
4
5
12
19
21
22
23
24
25

now

=COUNTIF(A1:A12,"=10")

will return 7 (12, 19, 21, 22, 23, 24, 25)

=COUNTIF(A1:A12,"=20")

will return 5 (21, 22, 23, 24, 25)

thus

=COUNTIF(A1:A12,"=10)-COUNTIF(A1:A12,"=20")

which is the same as

=7-5

will return 2


--

Regards,

Peo Sjoblom




"bsantona" wrote in message
...
still not working correctly. I have 12 cells that have data, of the 12

cells
2 have the data range between 10 - 20 so I'm looking for the formula to

give
me a count of 2 but the formulas below give me a count of 10 which makes
sense since it's subtracting.

Please help!


"JE McGimpsey" wrote:

One way:

=COUNTIF(rng,"=10")-COUNTIF(rng, "20")

Another:

=COUNTIF(rng,"<=20") - COUNTIF(rng, "<10")

Another:

=SUMPRODUCT(--(rng=10),--(rng<=20))

see http://www.mcgimpsey.com/excel/doubleneg.html for an explanation of
"--"



In article ,
"bsantona" wrote:

I'm trying to get a count of cells that have a range of data for

instance I
want a count of cells that have data between 10 - 20.

Any ideas would be appreciated.