Logical
How to Use AND and OR in Excel (Combine Conditions)
AND and OR let you test more than one condition at the same time. AND is TRUE only when every condition is true; OR is TRUE when at least one condition is true. Both return TRUE or FALSE.
On their own they are useful, but their real power comes from pairing them with IF to drive decisions. This guide shows both functions, how they differ, and how to combine them inside IF.
AND and OR syntax
=AND(logical1, logical2, ...) =OR(logical1, logical2, ...) | Argument | Required | What it does |
|---|---|---|
logical1 | Required | The first condition to test, e.g. B2>=60. Must evaluate to TRUE or FALSE. |
logical2 | Optional | The second condition. You can add up to 255 conditions in total. |
... more | Optional | Further conditions, each separated by a comma. |
Note: AND returns TRUE only if ALL conditions are true; OR returns TRUE if ANY condition is true. NOT() flips a single result. All work the same in Google Sheets.
Examples
Real, copy-paste-ready formulas.
1. AND inside IF
=IF(AND(B2>=60, C2="Yes"), "Eligible", "No") AND is TRUE only when both conditions hold, so IF returns "Eligible" only for rows that pass on both counts.
2. OR inside IF
=IF(OR(B2>10000, C2="Hold"), "Review", "OK") OR is TRUE when at least one condition is met, so either a large amount or a hold status triggers "Review".
3. AND and OR together
=IF(AND(B2>=60, OR(C2="EU", C2="UK")), "Approve", "Decline") Nest OR inside AND to mix logic: the score must pass AND the region must be one of two accepted values.
4. NOT to invert a test
=NOT(C2="Closed") NOT flips TRUE to FALSE and back, so this returns TRUE for every status that is not "Closed". You could also write C2<>"Closed".
How to write AND and OR step by step
- 1
Decide whether you need ALL conditions (AND) or ANY condition (OR) to be true.
- 2
In the result cell type =AND( or =OR(.
- 3
Enter each condition separated by a comma, e.g. B2>=60, C2="Yes".
- 4
Close the bracket ) and press Enter to see TRUE or FALSE.
- 5
To act on the result, wrap it in IF: =IF(AND(...), "Yes", "No").
Common errors and fixes
| Error | Why it happens | How to fix it |
|---|---|---|
Always returns FALSE (AND) | One condition can never be true, e.g. a typo in the text or the wrong cell reference. | Test each condition on its own first, then combine. Remember AND needs every one to pass. |
Always returns TRUE (OR) | A condition is always true, e.g. comparing a cell to itself or a test that is too broad. | Check each condition separately; OR only needs one to be true to return TRUE. |
Text comparison fails | Extra spaces are making "Yes" not equal " Yes" in a comparison. | Clean values with TRIM(); note text comparisons here ignore case but not spaces. |
#VALUE! | An argument is text that cannot be read as a logical condition. | Make sure every argument is a comparison that returns TRUE or FALSE, not a stray label. |
Frequently asked questions
What is the difference between AND and OR in Excel?
AND returns TRUE only when every condition is true; OR returns TRUE when at least one condition is true. Use AND for "all of these must hold" and OR for "any of these is enough".
How do I use AND and OR with IF?
Put them inside the IF test: =IF(AND(B2>=60, C2="Yes"), "Eligible", "No"). AND and OR return TRUE or FALSE, which IF then uses to choose its result.
Can I combine AND and OR in one formula?
Yes. Nest one inside the other, e.g. =IF(AND(B2>=60, OR(C2="EU", C2="UK")), "Approve", "Decline"). Use brackets carefully so the logic groups the way you intend.
Do AND and OR work in Google Sheets?
Yes, AND, OR, and NOT all work identically in Google Sheets, including inside IF.