countif

T

Tim

I want to count the the number cells in a column that
contain a percentage between 25% and 30%. I can't find
a "between" function for the formula.
 
H

Harald Staff

Hi Tim

We are 8 men here that's older than 50 years and 6 men here older than 60 years. So how
many is between 50 and 60 ?

.... Count all > 25% and from that subtract all > 30 %.
 
P

Peo Sjoblom

=COUNTIF(Range,">=25%")-COUNTIF(Range,">30%")

assuming you want to include 25 and 30%
 
A

Alan Beban

=COUNTBETWEEN(Range,25%,35%) where COUNTBETWEEN is:

Function COUNTBETWEEN(rng, valLow, valHigh, _
Optional inclLow As Boolean = True, _
Optional inclHigh As Boolean = True)
Select Case inclLow & inclHigh
Case "TrueTrue"
COUNTBETWEEN = Application.CountIf(rng, ">=" & valLow) _
- Application.CountIf(rng, ">" & valHigh)
Case "FalseFalse"
COUNTBETWEEN = Application.CountIf(rng, ">" & valLow) _
- Application.CountIf(rng, ">=" & valHigh)
Case "FalseTrue"
COUNTBETWEEN = Application.CountIf(rng, ">" & valLow) _
- Application.CountIf(rng, ">" & valHigh)
Case "TrueFalse"
COUNTBETWEEN = Application.CountIf(rng, ">=" & valLow) _
- Application.CountIf(rng, ">=" & valHigh)
End Select
End Function

Alan Beban
 

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

Top