# How to use Excel IF Condition

#### Description of Excel IF Condition Function

Excel IF Condition: This function will help to do a logical test and then if the test result is TRUE, we can assign a value. If the test results FALSE, we can assign another value. Basically, if we want to check 1=1, if it is TRUE we want the answer to show as “CORRECT” if it is FALSE then we want to show as “INCORRECT”.

##### The syntax of Excel IF Condition Function

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

• 1st Argument (Compulsory): logical_test
• 2nd Argument(Optional): [value_if_true]
• 3rd Argument(Optional):[value_if_false]

(For any Excel Function Syntax if we have square brackets then it is optional)

##### Arguments description of Excel IF Condition Function
• logical_test: 1st Argument here we need to select any cells for the logical test or else can write the logical test.
• [value_if_true]: 2nd Argument here we need to select any cell or update the value which we want to show if the logical test in 1st argument result is TRUE.This is an optional argument,  however it advisable to use this argument or else it will give 0
•  [value_if_false]: 3rd Argument here we need to select any cell or update the value which we want to show if the logical test in 1st argument result is FALSE. This is an optional argument, however it advisable to use this argument or else it will give 0.

Below are the Logical operators we can use in a logical test

Syntax: IF(logical_test,[value_if_true],[value_if_false])

 Logical Operator Name How to use Formula used Result = Equal to I want check 1=3 =IF(1=3,”Correct”,”Incorrect”) Incorrect > Greater than I want check 1>3 =IF(1>3,”Correct”,”Incorrect”) Incorrect >= Greater than or Equal to I want check 1>=3 =IF(1>=3,”Correct”,”Incorrect”) Incorrect < Less than I want check 1<3 =IF(1<=3,”Correct”,”Incorrect”) Correct <= Less than or Equal to I want check 1<=3 =IF(1<=3,”Correct”,”Incorrect”) Correct <> Not Equal to I want check 1<>3 =IF(1<>3,”Correct”,”Incorrect”) Correct
##### Explanation Excel IF Condition Function Examples

Example 1 We want to see the result as “Pass” if marks > 35 or else “Fail”

The Formula used in cell  G11=IF(F11>35,”Pass”,”Fail”)

Result Fail

Example 2 We want to see the result as “Pass” if marks >= 35 or else “Fail”

The Formula used in cell  G27=IF(F27>=35,”Pass”,”Fail”)

The Result Pass

Example 3 IF Total sales >=\$1,000 then eigible for 15% comission or else 5% commission

The formula used in cell  G47=IF(F47>=1000,15%*F47,5%*F47)

The Result is \$225.00

#### Excel Nested IF condition

Nested if condition means we can write multiple IF conditions within one if condition.

See below example of nested IF condition.

• Here we need to allocate grades to students as per the marks range.
• If a student gets 175-200 marks he/she should fall in Grade A
• If a student gets 150-174 marks he/she should fall in Grade B
• If a student gets Less than 150 he/she treated as Fail.