Formula for < and > results

T

TMF in MN

a b
1 Sue 8
2 Ann 5
3 Sue 4

I would like a formula if A=Sue and B is =>4 but =<6 the result is 1.

THANK YOU!!!!
 
M

Mike H

You didn't say what you wanted if the formula evaluated as false so this one
returns Unspecified.

=IF(AND(A1="Sue",AND(B1>=4,B1<=6)),1,"Unspecified")

Mike
 
T

TMF in MN

7ou're right, I did not clarify. I would like the formula to read column A
and column B so that the formula will count how many times Sue's numbers are
between 4 and 6, how many times Ann's numbers are between 4 and 6.... then
between 7 and 10.... 11 and 15... etc. THANK YOU!!!
 
D

David Biddulph

And of course you don't need the extra AND().
=IF(AND(A1="Sue",B1>=4,B1<=6),1,"Unspecified")
 
T

TMF in MN

I tried this but of course it didn't work!!!
countIF(AND(A1:A5="sue",AND(b1:b5>=4,B1:B5<=6)),1)
 
D

David Biddulph

=SUMPRODUCT(--(A1:A3="Sue"),--(B1:B3>=4),--(B1:B3<=6))
or
=SUMPRODUCT((A1:A3="Sue")*(B1:B3>=4)*(B1:B3<=6))
 
Top