Excel - IFS function

Suppose you have a problem like below, how are you going to solve it?
  • If score of a student is 90 or above, set the grade to A;
  • Else if the score is 80 or above, set the grade to B;
  • Else if the score is 70 or above, set the grade to C;
  • Else if the score is 60 or above, set the grade to D;
  • Else set the grade to F.
In the past, you will have to write nested IF functions. But now there is new Excel function IFS, which can solve the problem easily. To help you remember the IFS function, you can think it as the plural form of IF function, just like "apple" vs "apples".

The formula is:

=IFS(B2>90,"A",B2>80,"B",B2>70,"C",B2>60,"D",TRUE,"F")
The last 2 items in the formula [True, "False"] set the default value. It means that, if none of the previous criteria is met, it will return the value of "F".

You do not have to set the default value, but then you need to include all the possible values of the score so that a student with any score will get a grade. See the formula.

=IFS(B2>90,"A",B2>80,"B",B2>70,"C",B2>60,"D",B2<=60,"F")


Comments

Popular posts from this blog

Excel - Solver examples

Excel - Pivot Table

Excel - INDEX function