AND, OR and NOT in Excel With IF
By ExcelReady TeamUpdated 7 min read
The short answer
AND returns TRUE only when every condition is TRUE. OR returns TRUE when at least one condition is TRUE. NOT flips TRUE to FALSE and FALSE to TRUE. On their own they give TRUE or FALSE, so you usually put them inside IF's test, like =IF(AND(C2>=50000,D2>=4.5),"Bonus","No bonus").
Key takeaways
- AND needs every condition to be TRUE; one FALSE makes the whole answer FALSE.
- OR needs at least one TRUE condition; it is FALSE only when every condition is FALSE.
- NOT reverses a single test, so NOT(OR(...)) means 'none of these'.
- Use AND, OR and NOT as the first argument of IF to show a label instead of TRUE or FALSE.
- Each condition must be a full comparison: OR(B2="North",B2="South"), not OR(B2="North","South").
On this page+
AND, OR and NOT let one formula check several conditions at once. AND asks "are all of these true?", OR asks "is at least one true?", and NOT flips an answer. The Excel AND OR function pair is most useful inside IF, where it decides things like who gets a bonus or which orders need a check. This guide uses one small sales table throughout.
What do AND, OR and NOT return?#
All three return TRUE or FALSE. A condition is any test with a yes-or-no answer, such as C2>=50000.
| Function | Syntax | Returns TRUE when |
|---|---|---|
| AND | =AND(condition1, condition2, ...) | Every condition is TRUE |
| OR | =OR(condition1, condition2, ...) | At least one condition is TRUE |
| NOT | =NOT(condition) | The condition is FALSE |
Each condition is a comparison, built with signs like >=, < and <>. If those are new, read the guide to
Excel comparison operators first.
Here is the data. This quarter's targets are sales of at least 50000 and a rating of at least 4.5.
| Rep | Region | Sales | Rating | Hit both (AND) | Hit either (OR) |
|---|---|---|---|---|---|
| Lena | North | 54000 | 4.6 | TRUE | TRUE |
| Raj | East | 61000 | 4.1 | FALSE | TRUE |
| Sofia | West | 47000 | 4.8 | FALSE | TRUE |
| Ben | East | 39000 | 3.9 | FALSE | FALSE |
| Mei | South | 58000 | 4.5 | TRUE | TRUE |
How to use AND in Excel#
AND returns TRUE only if every condition is TRUE. One FALSE makes the whole answer FALSE.
=AND(C2>=50000,D2>=4.5)Lena hits both targets, so she gets TRUE. Raj has the sales but a 4.1 rating, so he gets FALSE. Mei has exactly 4.5,
and >= includes it, so she gets TRUE. Type 50000 without a comma: inside a formula, a comma separates the conditions.
AND is also the standard way to check whether a value is between two numbers:
=AND(B2>=10,B2<=20)This is TRUE for any value from 10 to 20, both ends included. Use > and < instead if the ends should be left out.
The same pattern works for dates, because Excel stores dates as numbers:
=AND(A2>=DATE(2025,1,1),A2<=DATE(2025,3,31))This is TRUE for any date in the first quarter of 2025. Build the dates with DATE rather than typing "1/1/2025" in quotes, which is text and won't compare correctly.
How to use OR in Excel#
OR returns TRUE if at least one condition is TRUE. It is FALSE only when every condition is FALSE.
=OR(C2>=50000,D2>=4.5)Raj and Sofia each hit one target, so both get TRUE. Only Ben, who missed both, gets FALSE.
A common mistake is writing OR like a sentence:
=OR(B2="North","South")This does not check for South. Each condition must be a complete test, so write =OR(B2="North",B2="South"). Excel
can't treat the word "South" on its own as TRUE or FALSE, so the short version gives a #VALUE! error instead.
How to use NOT in Excel#
NOT flips one value: TRUE becomes FALSE and FALSE becomes TRUE.
=NOT(B2="North")This is TRUE for every rep outside North. For a single test, B2<>"North" does the same job and is shorter. NOT
earns its place around AND or OR: NOT(OR(...)) means "none of these is true", and NOT(AND(...)) means "not all of
these are true".
NOT is also handy with the IS functions. =NOT(ISBLANK(C2)) is TRUE when C2 has something in it, which is a clear way
to write "this row has been filled in".
How to use AND, OR and NOT with IF#
On their own, these functions only show TRUE or FALSE. Put them in IF's test to show a label or run a calculation:
=IF(AND(C2>=50000,D2>=4.5),"Bonus","No bonus")
=IF(OR(C2<40000,D2<4),"Review","OK")
=IF(NOT(OR(C2>=50000,D2>=4.5)),"Coach","OK")| Rep | Bonus | Review | Coach |
|---|---|---|---|
| Lena | Bonus | OK | OK |
| Raj | No bonus | OK | OK |
| Ben | No bonus | Review | Coach |
| Mei | Bonus | OK | OK |
Read the brackets carefully: the AND or OR closes before the comma that starts IF's results. In the third formula,
NOT( and OR( each need a ) before "Coach". If IF itself is new, see
the Excel IF function explained simply.
Using the Excel AND OR function together in one test#
You can nest OR inside AND, or AND inside OR, to build rules with "and" and "or" in them. Say a bonus needs sales of at least 50000 and the rep must work in North or South:
=IF(AND(C2>=50000,OR(B2="North",B2="South")),"Bonus","No bonus")Excel works out the inner OR first, then the AND. Lena (North, 54000) and Mei (South, 58000) get Bonus. Raj has 61000 in sales but works in East, so the OR is FALSE and so is the AND.
AND and OR work on one row at a time. To count or add up the rows that meet several conditions, use COUNTIFS
or SUMIFS instead: =COUNTIFS(C2:C6,">=50000",D2:D6,">=4.5") counts the reps who hit both targets (2 here). Each extra
pair of range and criteria works like another condition inside AND. See
COUNTIFS and SUMIFS with several conditions.
When a rule has many "or" options on the same cell, like ten region names, a lookup list is easier to maintain. For turning codes into labels, see the SWITCH function.
What are the most common mistakes?#
These cause most wrong answers:
| Mistake | What happens | Fix |
|---|---|---|
=AND(C2>=50,000,D2>=4.5) | The comma splits 50,000 into two arguments | Type 50000 |
=OR(B2="North","South") | #VALUE! | Repeat the cell: B2="South" |
| AND where the rule says "either" | Too few TRUE results | Use OR |
> where the rule says "at least" | Values on the limit are missed | Use >= |
Text without quotes: B2=North | #NAME? | Write B2="North" |
If a condition refers to a cell that holds an error, AND and OR return that error too. Fix the source cell, or see IFERROR, used the right way for when hiding it makes sense.
Current Excel versions accept up to 255 conditions in one AND or OR. There is also XOR (Excel 2013 and later), which returns TRUE when an odd number of conditions are TRUE. With two conditions, that means exactly one. For the full IF syntax, see the IF function guide.
Practise it#
Try the Review exercise on this page, then practise AND, OR and NOT in a live spreadsheet. The lesson uses the same sales reps, and you build each check yourself, ending with a NOT(OR(...)) coaching flag.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
A rep needs a review if their sales are under 40000 OR their rating is under 4. In E5, check Ben's row: show Review if either condition is TRUE, and OK if not. Use OR inside IF, with C5 and D5.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Check | |||||
| 2 | ||||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 | ||||||
| 9 |
Tip: OR goes where IF's test would go: =IF(OR(condition1,condition2),... then the two results in quotes.
Practise this in a lesson
Frequently asked questions
How do I use IF with AND in Excel?
Put AND as the test of IF: =IF(AND(C2>=50000,D2>=4.5),"Bonus","No bonus"). IF shows the first result only when every condition inside AND is TRUE.
Can I use AND and OR in the same formula?
Yes. Nest one inside the other, like =AND(C2>=50000,OR(B2="North",B2="South")). Excel works out the inner OR first, then the AND.
How do I check if a number is between two values?
Use AND with two comparisons: =AND(B2>=10,B2<=20) is TRUE when B2 is from 10 to 20, both included. Use > and < if the ends should be left out.
How many conditions can AND and OR take?
Up to 255 conditions each in current Excel versions. If you need many, a lookup table or COUNTIFS is usually easier to read.
What does NOT do in Excel?
NOT reverses a TRUE or FALSE value. =NOT(B2="North") is TRUE for every region except North, the same as B2<>"North".