Countif Function with and Statement

M

Matt

I am trying to count the occourances in a row of data that are between $20 &
$25. Based on postings I have tried a couple of options...both are resulting
in "0".

=COUNTIF(F4:AK4,"and(F4:AK4>20,F4:AK4<25)")
=SUMPRODUCT(--(F3:AK3=">20"),--(F3:AK3="<25"))
Any Ideas??
 
P

Peo Sjoblom

=COUNTIF(F4:AK4,">20")-COUNTIF(F4:AK4,">=25")

or


=SUMPRODUCT(--(F3:AK3>20),--(F3:AK3<25))


note that this will not include 20 or 25,
if so use

=COUNTIF(F4:AK4,">=20")-COUNTIF(F4:AK4,">25")


or

=SUMPRODUCT(--(F3:AK3>=20),--(F3:AK3<=25))
 
M

Matt Cromer

Peo -
Thank you...
I modified your last formula to include 20, but not include 25. See below

=SUMPRODUCT(--(F3:AK3>=20),--(F3:AK3<25))
Works fine, Thanks again

Matt
 

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