View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default How do I Countif for a range of values

One way:
=COUNTIF(A1:A30,"<10")-COUNTIF(A1:A30,"<=5")
and another:
=SUMPRODUCT(--(A1:A305),--(A1:A30<10))

=sumproduct() likes to work with numbers. The -- stuff changes trues to 1's and
falses to 0's.



iMartyn wrote:

I want to check a range of numeric values and count the number that are
between 5 and 10 say. I've tried "=COUNTIF(A1:A30, "5 and <10") but
doesn't seem to work.
Can this be done ?

PS -I'm aware I could count each single value (eg 5, 6, 7, 8, 9, 10) and
then sum separately, but looking for a neater way to do it.

Thanks
iMartyn


--

Dave Peterson