IF function with multiple conditions using less than and greater than

Solved
Camcam -  
 Camcam -
Hello,

I'm having some issues with an Excel formula.

I would like:
- If AA2 is less than 1, then 1
- If AA2 is between 1 and 5 inclusive, then 2
- If AA2 is between 6 and 10 inclusive, then 3
- If AA2 is greater than 10, then 4

What is wrong with my formula?

=IF(AA2<1,1,IF(AND(AA2>=1,AA2<=5),2,IF(AND(AA2<=6,AA2<=10),3,IF(AA2>10,4))))

Excel seems to work fine for giving me 1 and 4, but it's the 2 and 3 that aren't working...

Thank you for your help!!

1 answer

  1. via55 Posted messages 14393 Registration date   Status Member Last intervention   2 759
     
    Hello

    You can simplify your formula already:
    =IF(AA2<1,1,IF(AA2<=5,2,IF(AA2<=10,3,4)))

    Best regards
    Via

    --
    "Imagination is more important than knowledge." A. Einstein
    3
    1. Camcam
       
      Why make things complicated when they can be simple?
      Thank you, it's perfect!
      0