0

This is an grading formula based on the score.

If score < 4 Then LEVEL 1
If score > 4 and score < 9 LEVEL 2
If score > 8 and score < 13 LEVEL 3
If score > 12 and score < 15 LEVEL 4
If score > 15 LEVEL 5

I really could not figure out, Where is the mistake. Please help.

=IF(A1<4,"LEVEL 1",IF(AND(A1>4,A1<9),"LEVEL 2",IF(AND(A1>8,A1<13,"LEVEL 3",IF(AND(A1>12,A1<17,"LEVEL 4",IF(A1>16,"LEVEL 5")))))))
4
  • 4th level is <17 and 5th level is >15? Commented Sep 29, 2016 at 11:51
  • Thanks for pointing out. I corrected the mistake. Commented Sep 29, 2016 at 12:05
  • I am assuming the levels are <4, 4-7,8-11,12-14,15 and above. If this is right, I have a simpler formula =min(int(A1/4)+1, 5) Commented Sep 30, 2016 at 1:40
  • ="Level "&min(int(A13/4)+1, 4) Commented Sep 30, 2016 at 1:42

5 Answers 5

3

You don't need AND(). If 1st condition doesn't pass automatically number is greater than 4 thus you just check if it is lower that 9 and so on... Or in a formula:

=IF(A1<4,"LEVEL 1",IF(A1<9,"LEVEL 2",IF(A1<13,"LEVEL 3",IF(A1<17, "LEVEL 4", "LEVEL 5"))))
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much. Today i learned something on the excel formula
1

You almost had it, you just need to make sure you close off the brackets for the AND statements:

=IF(A1<4,"LEVEL 1",IF(AND(A1>4,A1<9),"LEVEL 2",IF(AND(A1>8,A1<13),"LEVEL 3",IF(AND(A1>12,A1<17),"LEVEL 4",IF(A1>16,"LEVEL 5")))))

Comments

0

You forgot to close your AND's in the right before the then conditions.
The third IF ended up having a huge condition and no then or else statement, this happened with the last AND too.

=IF(A1<4,              "LEVEL 1",
 IF(AND(A1>4, A1<9),   "LEVEL 2",
 IF(AND(A1>8, A1<13),  "LEVEL 3",
 IF(AND(A1>12, A1<17), "LEVEL 4",
 IF(A1>16,             "LEVEL 5")))))

1 Comment

Brilliant. It worked like a charm. Thank you very much.
0

Glad you got it working, but there's another approach you might want to consider rather than nested IFs in a situation like this.

Create a table on another sheet or elsewhere on your sheet with your levels and the score needed to reach them: 0 Level 1 4 Level 2 8 Level 3 12 Level 4 15 Level 5

Then use a VLOOKUP or an INDEX(MATCH function to find matches. I like the INDEX(MATCH since it gives you more control.

=INDEX(Sheet1!$B$1:$B$5,MATCH(A1,Sheet1!$A$1:$A$5,1))

In this case, our list would be on Sheet1, with the Levels listed in column B and the required scores in column A, while our formula is on sheet 2 referencing actual scores that start in A1.

The INDEX function looks at an array - B1:B5 - and returns a value from a specified row in that array. The MATCH function looks at an array - A1:A5 - and returns the location in the array of the highest number that is less than or equal to the match value. It passes this result back to the INDEX so it can select the appropriate row.

This method is easier to maintain, modify and expand than a multi-level nested IF.

Comments

0

You could also use this formula:

=CHOOSE(MATCH(Score,{0,4,8,12,15},1),"Level 1","Level 2","Level 3","Level 4","Level 5")

Score is a defined name to the cell of your input.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.