Top Header ADS

Nested IF Condition in Excel

What is the Nested IF condition in Excel?

→ As we all know that the IF function returns one value if the condition is TRUE, or another value if the condition is FALSE.

→ As we can use the IF function when we want an answer on the condition base the same way if we need to check multiple conditions and we want to return the value based on the condition at that time we will use more than one if the condition that is called Nested If Condition. 

→ IF function is a Logical Function because this function works based on logic if the condition is true then return X value or the condition is false then return Y value likewise.

→ So we can put Nested If Condition into the Logical Function Category


How to use the Nested IF condition in Excel?

→ Nested If is simply we can say that the multiple IF conditions in a single formula.

→ We can use the Nested IF condition just by entering the formula in the spreadsheet.

What is the return value of the Nested IF condition?

→ The Nested IF condition will return a pre-defined True or False value based on the result of the logical test.

→ If the logical test's condition is true then the IF function returns value_if_true (you can refer to the syntax).

→ If the logical test's condition is false then the IF function returns value_if_false (you can refer to the syntax).

→ The same things get repeat till the last condition is not checked and based on that the final result will be shown.

 

What is the syntax of the IF function?

→ The syntax for the IF function in Microsoft Excel is:

=IF(logical_test, [value_if_true], [value_if_false])

Note: If you are running Excel 2016 or higher, try the new IFS function (to specify up to 127 conditions).

The Syntax Parameter or Syntax Arguments are:

→ logical_test - A value that we want to test or It is a logical expression that will say us true or false.

→ value_if_true - This value will return if the logical_test will return True or Pass.

→ value_if_false - This value will return if the logical_test will return False or Fail.

→ We will use this syntax for the Nested IF condition. We will understand with the help of the below example.


Examples of Nested IF Condition:

→ For a better understanding of the Nested IF Condition, we can take below examples that are related to students and their marks in the exam.

→ We will check the condition if the marks are greater than 35 then pass otherwise fail.

→ In the below excel sheet, we can see the students and their marks in the exam.

Example1:

→ We will check the if conditions such as if the students are getting marks greater than 35 in all subjects then pass otherwise fail.

→ As we know that the syntax of IF function is =IF(logical_test, [value_if_true], [value_if_false])

→ So from the below picture, we use this function for Nested IF Condition in the cell no E3, and the syntax will be =IF(B3>35,IF(C3>35,IF(D3>35,"Pass","Fail"),"Fail"),"Fail") for the below sheet.

Understanding of =IF(B3>35,IF(C3>35,IF(D3>35,"Pass","Fail"),"Fail"),"Fail") Formula:

 In easy language, we can understand the above formula as if B3>35 is true then it will check other condition if C3>35 if this is also true then it will again check the third condition if D3>35 is all this condition is true then we will get an answer as "Pass" otherwise if any of this condition is not fulfill then the formula will return the "Fail".

→ Here we can understand the syntax as below,

  1. =IF(B3>35  - This will check the Maths Markes is >35 or not if this is true then the function will check the Next condition or it is false then it will return "Fail"
  2. =IF(B3>35,IF(C3>35 - (we are considering that the B3>35 is true) so this function will check C3>35 or not if this is true then the function will check Next condition or it is false then it will return "Fail"
  3. =IF(B3>35,IF(C3>35,IF(D3>35,"Pass","Fail") - (we are considering that the C3>35 is true) so this function will check D3>35 or not if this is true then the function will return "Pass" or it is false then it will return "Fail"

→ So in this example, all subject's mark is >35 so the result will display as Pass.

Example of Nested IF Condition in Excel

Example2:

→ Now for better clarity, we are taking one more example as explained below.

→ Similarly, refer to the below photo for the second example.

→ So our formula is =IF(B4>35,IF(C4>35,IF(D4>35,"Pass","Fail"),"Fail"),"Fail")

→ So in this example, C4=34 so the Science mark is <35 so the result will display as Fail.

Example 2 of Nested IF Condition in Excel


👉 For a regular update:

➨ Join us (Telegram Channel)

➨ Join us (LinkedIn Page)


👉 Also Navigate Our Popular Category:

➨ Statistical Functions

➨ Date & Time Functions

➨ Logical Functions

➨ Lookup & Reference Functions

➨ Math Functions

➨ MS Excel Sitemap

➨ 7 QC Tools Excel Templates

➨ Lean Six Sigma Excel Templates

➨ MS Excel Templates

Post a Comment

Previous Post Next Post