IF Function in Excel
IF function comes under logical formulas in excel.
It checks whether the condition is met, returns a value if TRUE, returns another value if FALSE.
Syntax:
=IF(logical_test,value_if_true,value_if_false)
- logical_test : is the condition to be evaluated as TRUE and FALSE.
- value_if_true : the value to return if the condition is TRUE.
- value_if_false : the value to return if the condition is FALSE.
We can use IF function as follows :-
NOTE: If You want to drag down the same formula,you need to make the cell reference as absolute. You can make it absolute as:
The result is as follows:-
Nesting With IF function:-
By default, IF Function checks only one condition but if we want to check multiple conditions we will nest IF With AND Function.
Let us first see AND Function :
AND Function checks whether all arguments are TRUE, returns TRUE if all arguments are TRUE.
Syntax:
=AND(logical1,logical2,...)
logical1 and logical2 are conditions to be evaluated.
Now,In above example if we want to check whether the students are pass and got more than 80% we will do it with the help of AND function as:-
Result is as Follows:-
Now, in above example if we want to find that students got A Grade or any Other Grade. We will do it as:-
Result is as follows:-