If Formula using Greater than / Less than

C

crmulle

My formula is listed below. I would like the formula to look at cell f2 and
determine if it >=3 than 1 said:
=12 than 4. The formula is not working and I know it has something to do
with my logical test but i am not able to figure it out...any help would be
appreciated.

=IF(F2<=3,1,IF(F2>3<=6,2,IF(F2>6<=9,3,4)))

Carolyn
 
D

David Biddulph

But you don't need to test for F2>3 when you've already taken out those
where F2<=3, and you don't need to test for F2>6 when you've already taken
out those where F2<=6.
=IF(F2<=3,1,IF(AND(F2>3,F2<=6),2,IF(AND(F2>6,F2<=9),3,4))) can be simplified
to
=IF(F2<=3,1,IF(F2<=6,2,IF(F2<=9,3,4)))
 
D

Dan R

Hi Carolyn,

The previous post will work fine but infact there is no need to use the AND
function at all.

Try: =IF(F2<=3,1,IF(F2<=6,2,IF(F2<=9,3,4)))

Now this will return a value of 1 for all blank (or empty cells), to avoid
this use:

=IF(ISBLANK(F2),"",IF(F2<=3,1,IF(F2<=6,2,IF(F2<=9,3,4))))

Good look.

Danny
 
C

crmulle

Thank you!

Dan R said:
Hi Carolyn,

The previous post will work fine but infact there is no need to use the AND
function at all.

Try: =IF(F2<=3,1,IF(F2<=6,2,IF(F2<=9,3,4)))

Now this will return a value of 1 for all blank (or empty cells), to avoid
this use:

=IF(ISBLANK(F2),"",IF(F2<=3,1,IF(F2<=6,2,IF(F2<=9,3,4))))

Good look.

Danny
 
C

crmulle

Thank you.

David Biddulph said:
But you don't need to test for F2>3 when you've already taken out those
where F2<=3, and you don't need to test for F2>6 when you've already taken
out those where F2<=6.
=IF(F2<=3,1,IF(AND(F2>3,F2<=6),2,IF(AND(F2>6,F2<=9),3,4))) can be simplified
to
=IF(F2<=3,1,IF(F2<=6,2,IF(F2<=9,3,4)))
 
Top