Codementor Events

IF Function in Excel

Published Jan 18, 2022
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 :-

Screenshot (89).png

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:
Screenshot (90).png

The result is as follows:-
Screenshot (91).png

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:-
Screenshot (92).png

Result is as Follows:-
Screenshot (93).png

Now, in above example if we want to find that students got A Grade or any Other Grade. We will do it as:-
Screenshot (94).png

Result is as follows:-
Screenshot (95).png

Discover and read more posts from anshika vohra
get started
post commentsBe the first to share your opinion
Show more replies