Here’s a detailed explanation of logical functions in Excel with examples:
1. IF Function
The IF function is used to return one value if a condition is TRUE and another value if it’s FALSE.
Syntax:
=IF(logical_test, value_if_true, value_if_false)
Example:
| Product | Sales | Target | Met Target? (Formula) |
|---|---|---|---|
| Laptop | 1200 | 1000 | =IF(B2>=C2, "Yes", "No") |
| Mobile | 900 | 1000 | =IF(B3>=C3, "Yes", "No") |
- Explanation:
- If Sales (Column B) is greater than or equal to Target (Column C), return “Yes”; otherwise, return “No”.
- Result:
- Laptop: Yes
- Mobile: No
2. AND Function
The AND function checks if all conditions are TRUE. If all are TRUE, it returns TRUE; otherwise, it returns FALSE.
Syntax:
=AND(logical1, logical2, ...)
Example:
| Product | Sales | Target | In Stock | Eligible for Bonus? (Formula) |
|---|---|---|---|---|
| Laptop | 1200 | 1000 | Yes | =IF(AND(B2>=C2, D2="Yes"), "Yes", "No") |
| Mobile | 900 | 1000 | Yes | =IF(AND(B3>=C3, D3="Yes"), "Yes", "No") |
- Explanation:
- Check if:
- Sales (Column B) is greater than or equal to Target (Column C), AND
- In Stock (Column D) is “Yes”.
- If both conditions are TRUE, return “Yes”; otherwise, return “No”.
- Result:
- Laptop: Yes
- Mobile: No
- Check if:
3. OR Function
The OR function checks if any condition is TRUE. If at least one condition is TRUE, it returns TRUE; otherwise, it returns FALSE.
Syntax:
=OR(logical1, logical2, ...)
Example:
| Product | Sales | Target | In Stock | Under Consideration? (Formula) |
|---|---|---|---|---|
| Laptop | 1200 | 1000 | No | =IF(OR(B2>=C2, D2="Yes"), "Yes", "No") |
| Mobile | 900 | 1000 | Yes | =IF(OR(B3>=C3, D3="Yes"), "Yes", "No") |
- Explanation:
- Check if:
- Sales (Column B) is greater than or equal to Target (Column C), OR
- In Stock (Column D) is “Yes”.
- If either condition is TRUE, return “Yes”; otherwise, return “No”.
- Result:
- Laptop: Yes
- Mobile: Yes
- Check if:
4. NOT Function
The NOT function reverses the logical value of its argument:
- Returns TRUE if the argument is FALSE.
- Returns FALSE if the argument is TRUE.
Syntax:
=NOT(logical)
Example:
| Product | In Stock | Out of Stock? (Formula) |
|---|---|---|
| Laptop | Yes | =NOT(D2="Yes") |
| Mobile | No | =NOT(D3="Yes") |
- Explanation:
- If In Stock (Column D) is “Yes”, NOT will return FALSE, meaning “Out of Stock” is FALSE.
- If In Stock is “No”, NOT will return TRUE, meaning “Out of Stock” is TRUE.
- Result:
- Laptop: FALSE
- Mobile: TRUE
Combination Example
You can combine these functions for more complex logic.
Scenario:
Check if Sales exceed Target AND the product is in stock, OR the Target is below 800.
Formula:
=IF(OR(AND(B2>=C2, D2="Yes"), C2<800), "Approved", "Not Approved")
| Product | Sales | Target | In Stock | Status |
|---|---|---|---|---|
| Laptop | 1200 | 1000 | Yes | Approved |
| Mobile | 900 | 1000 | No | Not Approved |

Ankit Srivastava is an IT trainer, technology educator, and digital skills mentor with expertise in programming, data analytics, AI, and software development. He has successfully trained thousands of learners, with more than 10,000 student enrollments on Udemy. His practical teaching approach empowers students and professionals to build in-demand technical skills. Colorstech channel where Ankit posts video tutorials has more than 8000 Subscribers.