The If function is a powerhouse in Excel, allowing users to calculate values based on various conditions. This comprehensive guide illustrates how to use the If function with multiple conditions, accompanied by practical examples.
Simply put, the If function checks a value against predefined conditions. If the conditions are met, it returns one value; otherwise, it returns another.
1. Syntax: If(logical_test, Value if true, Value if false)
Breakdown:
- Logical_test: Condition expression.
- Value if true: Value returned if the condition is true.
- Value if false: Value returned if the condition is false.
In certain scenarios where problems involve multiple conditions, you might need to use additional functions like Or and And to combine them.
- When dealing with multiple conditions that must all be true simultaneously, you should incorporate the And function into the condition expression. The syntax for the And function is: And(logical1, logical2, ...)
- Conversely, when dealing with multiple conditions where the return value needs to satisfy at least one condition, you should include the Or function in the condition expression. The syntax for the Or function is: Or(logical1, logical2, ...), where logical represents the condition expressions.
2. Usage and Illustrative Examples.
Example 1: Using the If function with a single condition to evaluate.
For instance, consider determining the admission to 10th grade based on the results of 3 subjects. If the total score is greater than 24, the student passes; otherwise, they fail.
In the cell where calculation is needed, input the formula: = If(H7>24, 'Pass', 'Fail')

Press Enter and copy the formula for the remaining values to obtain results:

Example 2: Similar to example 1, but the admission condition requires that a student must have a total score of more than 18 and no subject score of 0.

Press Enter and copy the formula for the remaining values to get results:

As you can see, some candidates have a total score greater than 18 but have one subject score of 0, resulting in unfortunate disqualification.
Example 3: Classifying student academic performance based on their average score.
- If the average score is greater than or equal to 8.5 => classified as excellent academic performance.
- If the average score is greater than or equal to 6.5 and less than 8.5 => classified as good academic performance.
- If the average score is greater than or equal to 5 and less than 6.5 => classified as average academic performance.
- Otherwise, if the average score is less than 5 => classified as weak academic performance.


For example:
- A household raising chickens or ducks falls under the Livestock group, a household growing peanuts or bananas falls under the Crop cultivation group, a household raising shrimp or fish falls under the Aquaculture group.
Here there are 2 conditions and the condition 'or' should be used, so use the Or function. In the cell where you want to enter the formula: =IF(OR(D7='x',E7='x'),'Crop cultivation',IF(OR(F7='x',G7='x'),'Livestock','Aquaculture'))

Press Enter and Copy the formula for the remaining values to get the result:

Above is a detailed guide on how to use the if function with multiple conditions along with illustrative examples. Wishing you all success!
