countif in a value range?

  • Thread starter Thread starter pokdbz
  • Start date Start date
P

pokdbz

I would like to do a count if a value is within a range like
=COUNTIF(E3:E150,"<=89 and >=80")

But that doesn't work
 
You have to do it in two parts... count the values less than or equal to
your maximum value and subtract the count of the values **less than**
(hence, no equal sign) than your minimum value...

=COUNTIF(E3:E150,"<=89")-COUNTIF(E3:E150,"<80")

Rick
 
Try one of these:

=SUM(COUNTIF(E3:E150,{"<=89","<80"})*{1,-1})
or
=SUMPRODUCT((E3:E150>=80)*(E3:E150<=89))

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
I considered that approach....but...
If decimals can be in the list, it needs tweaking.
Values between 79 and 80, exclusive, trip it up.
(eg 79.5)

Perhaps:
=INDEX(FREQUENCY(E3:E150,{89,79.9999999999999}),)

--------------------------
Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top