ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Logic
  3. AND, OR and NOT in Excel With IF

AND, OR and NOT in Excel With IF

By ExcelReady Team·Updated October 30, 2026·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+
  1. What do AND, OR and NOT return?
  2. How to use AND in Excel
  3. How to use OR in Excel
  4. How to use NOT in Excel
  5. How to use AND, OR and NOT with IF
  6. Using the Excel AND OR function together in one test
  7. What are the most common mistakes?
  8. Practise it

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.

FunctionSyntaxReturns 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.

RepRegionSalesRatingHit both (AND)Hit either (OR)
LenaNorth540004.6TRUETRUE
RajEast610004.1FALSETRUE
SofiaWest470004.8FALSETRUE
BenEast390003.9FALSEFALSE
MeiSouth580004.5TRUETRUE

How to use AND in Excel#

AND returns TRUE only if every condition is TRUE. One FALSE makes the whole answer FALSE.

Excel formula
=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:

Excel formula
=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:

Excel formula
=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.

Excel formula
=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:

Excel formula
=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.

Excel formula
=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:

Excel formula
=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")
RepBonusReviewCoach
LenaBonusOKOK
RajNo bonusOKOK
BenNo bonusReviewCoach
MeiBonusOKOK

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:

Excel formula
=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:

MistakeWhat happensFix
=AND(C2>=50,000,D2>=4.5)The comma splits 50,000 into two argumentsType 50000
=OR(B2="North","South")#VALUE!Repeat the cell: B2="South"
AND where the rule says "either"Too few TRUE resultsUse OR
> where the rule says "at least"Values on the limit are missedUse >=
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.

fx
ABCDEF
1
Rep
Region
Sales
Rating
Check
2
Lena
North
54000
4.6
3
Raj
East
61000
4.1
4
Sofia
West
47000
4.8
5
Ben
East
39000
3.9
6
Mei
South
58000
4.5
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

LessonAND, OR and NOTCheck several conditions at once with AND and OR, flip a result with NOT, and combine them inside IF.Function guideIFLearn Excel's IF function with practical examples: flag budgets, label rows and return blanks. Avoid the classic mistakes and practice live.

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".

Sources

  • AND function - Microsoft Support
  • OR function - Microsoft Support
  • NOT function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What do AND, OR and NOT return?
  2. How to use AND in Excel
  3. How to use OR in Excel
  4. How to use NOT in Excel
  5. How to use AND, OR and NOT with IF
  6. Using the Excel AND OR function together in one test
  7. What are the most common mistakes?
  8. Practise it

Keep reading

Logic· 6 min read

IFERROR in Excel: Hide Errors the Right Way

IFERROR returns a formula's normal result, or a value you choose if the formula gives an error: =IFERROR(value, value_if_error). For example, =IFERROR(B2/C2,0) shows 0 instead of #DIV/0!. It catches every error type, including mistakes in your own formula, so check the formula works first, and use IFNA for lookups.

Logic· 6 min read

Excel Comparison Operators: =, <>, >, <, >=, <=

In Excel, "not equal to" is written <>, so =A2<>"Delivered" returns TRUE when A2 is anything other than Delivered. Excel has six comparison operators: = equal, <> not equal, > greater than, < less than, >= greater than or equal, and <= less than or equal. Each returns TRUE or FALSE.

Logic· 7 min read

The SWITCH Function in Excel (Turn Codes Into Labels)

The Excel SWITCH function compares one value with a list of options and returns the result paired with the first exact match: =SWITCH(D2,"P","Pending","S","Shipped","Other"). The last single value is the default, shown when nothing matches. Without a default, SWITCH returns #N/A. SWITCH needs Excel 2019 or later.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free