The OR function in Excel evaluates multiple conditions and returns TRUE if at least one condition is TRUE; otherwise, it returns FALSE.
Syntax and Arguments
OR(logical1, [logical2], …)
Arguments:
- logical1 (required): The first condition or logical test to evaluate.
- logical2, … (optional): Additional conditions or logical tests up to 255 to evaluate.
Explanation of Syntax and Arguments
- logical1: This will be the first condition you want Excel to check. For example, if you want to check if the value in cell A1 is greater than 10, you can enter A1>10.
- logical2, …: These are the additional conditions you can specify. For instance, if you want to check if the value in the cell B1 is less than 20, you can enter B1<20.
If any of the conditions are TRUE, the OR function returns TRUE. It returns FALSE only when all of the conditions supplied are FALSE.
How to Use the OR Function
The OR function is often used when you have decision-making scenarios, data validation, and conditional formatting. It also uses logical operators like =, <, >, <=, and >= within the conditions.
Examples
Example 1: Pass or Fail Check
Scenario: A school evaluates students to check if they pass based on the scores they have scored in Math or Science being above 50.
Formula in E3:
=OR(C3>50,D3>50)
The formula checks if either the Math score or Science score is above 50. As the score of Arjun passes in Science, the result is TRUE and for Priya, both of the criteria don’t meet and the result is FALSE.
Example 2: Weekend Check for Attendance
Scenario: A company evaluates attendance records to mark employees who attended on weekends (Saturday and Sunday in this scenario).
Formula in D3:
=OR(C3="Saturday",C3="Sunday")
The formula checks if the day for each employee is either Saturday or Sunday. Meera’s attendance on Saturday returns TRUE, while Rahul’s attendance on Monday returns FALSE.
Example 3: Discount Eligibility
Scenario: A store offers discounts to customers who spend more than $500 or purchase more than 10 items.
Formula in E3:
=OR(C3>500,D3>10)
The formula checks if the sales amount exceeds $500 or if the customer has purchased items more than 10. Aman qualifies based on the spending and Anjali qualifies based on items purchased. However, Sneha has not met both criteria and the result is FALSE.
Example 4: Scholarship Eligibility
Scenario: A university is providing scholarships if the student’s score is above 90 in Math or 85 in Science.
Formula in E3:
=OR(C3>90,D3>85)
The formula checks if either Math or Science scores meet the criteria. Rohan doesn’t qualify for either of the criteria and the result is FALSE. However, Kavya qualifies based on her score in Science.
Combining OR with Other Functions
Example 1: OR with IF for Leave Approval
Scenario: An organization approves leave if the reason is either “Medical” or “Emergency”.
Formula in D3:
=IF(OR(C3="Medical", C3="Emergency"), "Approved", "Not Approved")
The IF function uses OR to check if the reason for leave is either a Medical or Emergency and for Alex leave is approved while for Mia it is not.
Example 2: OR with AND for Multi-Criteria Discount
Scenario: A store offers discounts if the customers are members and either spend more than $500 or purchase more than 10 items.
Formula in F3:
=IF(AND(E3="Yes", OR(C3>500,D3>10)), "Yes", "No")
The AND function ensures the customer is a member, and the OR checks if the sales amount or items purchased are met. Aman qualifies for the discount whereas Anjali doesn’t.
Example 3: OR with NOT for Absence Check
Scenario: A company marks employees absent if they didn’t attend on either Saturday or Sunday.
Formula in E3:
=NOT(OR(C3="Saturday",D3="Sunday"))
The OR function checks if the employee attended on either Saturday or Sunday, and the NOT function reverses the result. Vijay is marked as present, while Meera is marked as absent.
The OR function is a powerful tool when you want to evaluate multiple conditions in Excel where either one of the criteria needs to be TRUE. You can check eligibility, decision-making, or also advanced data analysis as it simplifies logical operations.