How to use the IF Function
The Microsoft Excel IF function returns one value if the condition is TRUE, or another value if the condition is FALSE.
The IF function is a built-in function in Excel that is categorized as a Logical Function. It can be used as a worksheet function in Excel. As a worksheet function, the IF function can be entered as part of a formula in a cell of a worksheet.
Syntax
The syntax for the IF function in Microsoft Excel is:
IF( condition, [value_if_true], [value_if_false] )
Parameters or Arguments
- condition
- The value that you want to test.
Relational Operators:
> ---- Greater than< ---- less than>= ---- greater than & Equal To<= ----- Less than & Equal To= -------Equal to<> ----- Not Equal to- value_if_true
- Optional. It is the value that is returned if condition evaluates to TRUE.
- value_if_false
- Optional. It is the value that is return if condition evaluates to FALSE.
Example
Let's look at some Excel IF function examples and explore how to use the IF function as a worksheet function in Microsoft Excel:-
Create a simple table consist of Value if value is greater than 10 then result would be larger or smaller than 10 result would be smallerAs you seen in example value is 0 the condition get False that why it is showing smaller
after changing value the condition become true result shown that value is larger
Example 2:
- in this example we have selected one fruit to buy if it is available on specific price we have set the condition if(and(fruit name =apple & price<70),"buy it","don't Buy ")
Applying function
- As you have seen condition becomes false result would be Don't Buy
-
Comments