View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Count of Number Values Greater Than, Less Than

maybe
=countif(d2:d9,"=0")-countif(d2:d9,"36")
This way you are counting all values =0 and subtracting those values that
are greater then the range you don't want to include.
--
JNW


"Anne" wrote:

Thanks, but I need =0 AND <=36. It's the AND part that screws it all up.

=COUNTIF(D2:D9,"=0")-COUNTIF(D2:D9,"=<36") returns the wrong value. So
does =SUMPRODUCT(--(D2:D9=0)--(D2:D9<=36))

Values are all formated as numbers. I can't figure out what it's counting.

I just discovered that =SUM(IF((D2:D90)*(D2:D9<=36),1,0)) using
ctrl+shift+enter works. I'm grateful that it does, but why does it perform a
count when the function is to sum?

"David Billigmeier" wrote:


These should work...
=COUNTIF(A1:A10,"=7")
=SUMPRODUCT(--(A1:A10=7))

If those don't work your values might be formatted as text, in which case try:
=SUMPRODUCT(--(--A1:A10=7))

--
Regards,
Dave


"Anne" wrote:

How do you perform this count on a range of cells?

CountIf and SumProduct are both returning the wrong total, in more than one
column.