MS Excel: OR Function, syntax and advanced explanation
- Fakhriddinbek
- Apr 25
- 2 min read
The OR function in Excel is a logical function that helps you test multiple conditions at once. It returns TRUE if at least one of the conditions is true and FALSE only if all conditions are false. OR is incredibly useful when paired with other functions like IF, AND, and NOT to create smart formulas and automate decision-making in your spreadsheets.

Syntax:
OR(logical1, [logical2], ...)
logical1, logical2, … – These are the conditions (logical tests) you want to evaluate.
Beginner Level: Basic Use of OR
Example 1: Check If a Value Matches One of Two Options
A (Product) | B (OR Check) |
Apple | =OR(A2="Apple", A2="Banana") → TRUE |
Mango | =OR(A3="Apple", A3="Banana") → FALSE |
Returns TRUE if the product is Apple or Banana.
Intermediate Level: Use OR with IF
OR is often used with IF to create more dynamic formulas.
Example 2: Pass or Fail Based on Two Subjects
A (Math) | B (English) | C (Result) |
45 | 60 | =IF(OR(A2>=50, B2>=50), "Pass", "Fail") → Pass |
30 | 40 | =IF(OR(A3>=50, B3>=50), "Pass", "Fail") → Fail |
This checks if a student passed either subject.
Advanced Level: OR with AND, NOT, and Complex Logic
Now let’s combine OR with other logical functions.
Example 3: OR + AND – Complex Criteria
A (Age) | B (Country) | C (Eligible?) |
25 | USA | =IF(AND(A2>=18, OR(B2="USA", B2="Canada")), "Yes", "No") → Yes |
17 | USA | =IF(AND(A3>=18, OR(B3="USA", B3="Canada")), "Yes", "No") → No |
30 | Mexico | =IF(AND(A4>=18, OR(B4="USA", B4="Canada")), "Yes", "No") → No |
Checks if age is 18+ and the country is either USA or Canada.
Example 4: OR with NOT – Reverse Logic
A (Status) | B (Is Not Active or Pending?) |
Active | =OR(NOT(A2="Active"), NOT(A2="Pending")) → TRUE |
Inactive | =OR(NOT(A3="Active"), NOT(A3="Pending")) → TRUE |
NOT reverses the condition. Be cautious: logic can get tricky here!
Real-Life Use Cases
Scenario | Formula Example |
Check if date is weekend | =OR(WEEKDAY(A2)=1, WEEKDAY(A2)=7) |
Flag employee if missing email or phone | =OR(B2="", C2="") |
Discount if VIP or order over $500 | =IF(OR(A2="VIP", B2>500), "Discount", "No Discount") |
Summary Table
Level | Key Feature | Example Formula |
Beginner | Basic condition checking | =OR(A2="Apple", A2="Banana") |
Intermediate | Use OR with IF | =IF(OR(A2>=50, B2>=50), "Pass", "Fail") |
Advanced | Combine OR with AND, NOT, IF | =IF(AND(A2>=18, OR(B2="USA", B2="Canada")), "Yes", "No") |
Conclusion
The OR function is a vital part of Excel’s logical toolkit. It’s easy to learn but incredibly powerful when combined with other functions. From simple checks to complex logic involving multiple conditions, OR can make your spreadsheets smarter, more flexible, and easier to automate.
コメント