Introduction to IF Function
Logical functions in Excel are predefined formulas that evaluate a given condition or set of conditions and return a Boolean value (TRUE or FALSE) based on whether the condition is met or not. They are used to test the truth or falsehood of a statement or a condition, and to make decisions based on the result. In this blogpost, we will discuss about IF Function.
IF Function returns a value if the condition you specify is TRUE, else some other value. In simple words, the IF function can test a condition first and returns a value based on the result of that condition.
Download Sample File
Download SAMPLE FILE to work, practice and master the LOGICAL Functions in Excel.
Syntax of IF Function
IF(logical_test,value_if_true,value_if_false)
Arguments of IF Function
- logical_test: The condition which you want to evaluate.
- value_if_true: The value which you want to get if that condition is TRUE.
- value_if_false: The value which you want to get if that condition is FALSE.
Notes
- The maximum number of nested conditions you can perform is 64.
- You can use comparison operators to evaluate a condition.
Example of IF Function in MS Excel
In the below example, we have used a comparison operator to evaluate different conditions.
- We have used a specific text to get in the result if the condition met or not.
- You can also use TRUE and FALSE to get in result.
- If you skip specifying a value to get the result if the condition is TRUE, it will return zero.
- And if you skip specifying a value to get the result if the condition is FALSE, it will return zero.
In the below example, we have used the IF function to create a nesting formula.
We have specified a condition and if that condition is false then we have used another IF to evaluate another condition and perform a task and if that condition is FALSE we have used another IF. In this way, we have used IF five times to create a nesting formula. You can use the same for more number of times for a nesting formula.
Other Excel Logical Functions Tutorials
You can explore and master other Logical functions in Microsoft Excel. Here is a complete list of Logical functions available in Microsoft Excel.