View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default countif with non-continous ranges

Peo Sjoblom wrote...
....
or

=SUMPRODUCT(COUNTIF(INDIRECT({"U5:U10","U12:U17"} ),3.028))
/COUNT(U5:U10,U12:U17)

since COUNT count numbers only while COUNTA count numbers and text

....

If these were all numbers, there's an alternative that avoids using the
volatile function INDIRECT.

=INDEX(FREQUENCY((U5:U10,U12:U17),3.028-{1E-12,0}),2)/COUNT(U5:U10,U12:U17)

Then again, there's only one excluded cell, so brute force isn't that
difficult.

=(COUNTIF(U5:U17,3.028)-COUNTIF(U11,3.028))/(COUNT(U5:U17)-COUNT(U11))