# IF Function in Excel

## Explanation

IF Function works on the following logical operators:-

**Syntax**

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

## Arguments

**Logical_Test** – Logical _test is a criteria or condition, if the criteria or the condition is met with cell value, like if cell “A1>70”, or “A1=70”, or “A1<70”.

**Value_if_true – **[optional] If the above-given criteria met then it will produce the result as TRUE. i.e. condition met, for example, the student is “Pass” if cell value A1 is greater than 33 =IF(A1>33,“Pass”,”Fail”).

**Value_if_false – **[optional] If the given criteria are not met then it will produce the result as FALSE. i.e. condition is not met. for example, the student is “Failed” if cell value A1 is less than 33 =IF(A1>33,“Pass”,“Failed”).

** Example 1**–

**value_if_true**– [optional]

In this image 2nd option omitted, we can see where the criteria are not met “0” is appearing in that cell. Leave this cell blank and write the formula as =IF(A11>20,”Approve”,”) by putting (“”) for blank output.

** Example 2**–

**value_if_false**[Optional]

In this image, we have omitted 1st argument i.e. TRUE by putting simple “,” in the space provided or we can leave it blank also by putting (” “) into the space provided.

__Example 3__

__Example 3__

To understand IF Function better, see above image. Here we have a **name**, **score** list and** result** in the columns.

If somebody has scored “above or equal to 33” he will “Pass” and if somebody could not get marks at least “33” he is “Fail”.

__Example 3__

__Example 3__

## Useful Notes

- We can set TRUE/FALSE condition as “Pass” or “Fail”, “Agree” or “Disagree”, “Yes” or “No”, “if the target met”,or “Not met target” etc.
- IF function get only one value from two conditions TRUE/FALSE and cannot get both value at the same time.
- IF function produces #Name error if the arguments are not typed correctly or invalid.

So I hope I have explained this function in brief and if after this having any doubt or question in mind please feel free to share.

Regards

Narendra