How to Use IF Function in Excel

You can learn here, what IF function is and how to use it.

IF Function Basics

IF function is one which are used the most often in Excel. IF is a logical function. But you can not only check TRUE / FALSE values.

Excel if function logical test true false

IF Function contains from 3 parts:

  1. Logical test – IF function checks if this test is true or false in the cell
  2. Value if true – you can use it if logical test is true
  3. Value if false – put the argument here for the failed test

Pass/Fail Evaluation

Consider a scenario where you have a table of exam results, and you want Excel to determine if a student passed or failed the exam automatically.

Excel IF function exam results table

You can use the IF function for this purpose. Here’s the formula:

=IF($C3>50,”PASSED”,”FAILED”)

Excel IF function simple formula example

In this formula:

  • $C3 represents the student’s score.
  • The logical test checks if the score is greater than 50.
  • If the score is greater than 50, Excel displays “PASSED”; otherwise, it shows “FAILED.”

Grading System

Now, let’s tackle a more complex scenario where you want to assign grades to students based on their scores.

Excel IF function table more difficult

The grading criteria are as follows:

  • A: >90 points
  • B: >75 points
  • C: >60 points
  • D: >50 points
  • E: ≤50 points

You can use nested IF functions to achieve this. Here’s the formula:

=IF($C3>90,”A”,IF($C3>75,”B”,IF($C3>60,”C”,IF($C3>50,”D”,”E”))))

Excel IF function logical test

This formula checks multiple logical tests sequentially to determine the appropriate grade for the student based on their score.

See also  How to Use the Average Function in Excel