Hands-On Excel

Hands-On Excel Challenges AND, OR

Excel AND and OR functions

=AND(B2>=50000, C2>=4) is TRUE only when both tests are true. =OR(B2<30000, C2<3) is TRUE when at least one of them is. Both give TRUE or FALSE on their own.

CoreAbout 3 minutesFree, no sign-upBy Updated

Try it yourself

10 · AND, OR · Core

Both or either?

A rep earns a bonus with sales of 50,000 or more and a rating of 4 or more. A rep gets coaching with sales under 30,000 or a rating under 3. Show TRUE or FALSE in columns D and E.

AND(test1, test2) is TRUE only when every test is true. OR(test1, test2) is TRUE when at least one is. They give TRUE or FALSE on their own, so you don't need IF here.

reps.xlsx
Ready

Write in the green cells, then press Check. Click a cell while typing to insert it, drag to select a range, F4 adds $, Esc cancels.

The guide · AND, OR

Syntax

=AND(logical1, [logical2], …)
=OR(logical1, [logical2], …)

Each argument is a test that is TRUE or FALSE, like B2>=50000. You can give them up to 255 tests, but two or three is normal.

Which one?

Sales ≥ 50,000Rating ≥ 4ANDOR
TRUETRUETRUETRUE
TRUEFALSEFALSETRUE
FALSETRUEFALSETRUE
FALSEFALSEFALSEFALSE

Read the rule out loud. "Sales of 50,000 and a rating of 4" is AND. "Sales under 30,000 or a rating under 3" is OR. The two only disagree when exactly one test is true, so that's the row to check.

A worked example

Dua sold 75,000 but has a rating of 2.5. For the bonus, =AND(B5>=50000, C5>=4) is FALSE: one test out of two isn't enough. For coaching, =OR(B5<30000, C5<3) is TRUE: the rating alone is enough.

Words instead of TRUE and FALSE

To show "Yes" or "No", put AND or OR inside an IF: =IF(AND(B2>=50000, C2>=4), "Yes", "No"). Close the AND bracket after the last test and before the "Yes". There's also XOR, which is TRUE when exactly one test is true, and NOT, which flips TRUE and FALSE.

Common mistakes

FAQ

How do I use AND and OR in Excel?
Give them tests separated by commas. =AND(B2>=50000,C2>=4) is TRUE when both are true; =OR(B2<30000,C2<3) is TRUE when either one is.
What is the difference between AND and OR in Excel?
AND needs every test to be true. OR needs at least one. They give different answers only when some tests are true and others are false.
How do I use IF with AND in Excel?
Put AND as the test of the IF: =IF(AND(B2>=50000,C2>=4),"Bonus","No bonus").
Can I combine AND and OR in one formula?
Yes, by nesting them: =AND(B2>=50000,OR(C2>=4,D2="Yes")) is TRUE when sales are high enough and at least one of the other two tests is true.

All challenges

  1. 01 Add it upSUM Starter · 3 min
  2. 02 Find the averageAVERAGE Starter · 3 min
  3. 03 Write once, fill downRelative references Starter · 3 min
  4. 04 Lock it with $Absolute references Core · 3 min
  5. 05 Lock just the row or the columnMixed references Advanced · 3 min
  6. 06 Percent of a totalPercentages Starter · 3 min
  7. 07 Up or down by how much?Percent change Core · 3 min
  8. 08 Select to the end in one moveCtrl + Shift + arrow Core · 3 min
  9. 09 Pass or fail?IF Core · 3 min
  10. 10 Both or either?AND, OR Core · 3 min
  11. 11 Grade bands with nested IFNested IF Core · 3 min
  12. 12 Count the ones that matchCOUNTIF Core · 3 min
  13. 13 Add up the ones that matchSUMIF Core · 3 min
  14. 14 Use a cell as the conditionCriteria in a cell Core · 3 min
  15. 15 Count with two conditionsCOUNTIFS Core · 3 min
  16. 16 Add up with two conditionsSUMIFS Core · 3 min
  17. 17 Look it upVLOOKUP Core · 3 min
  18. 18 Find the right bracketVLOOKUP approximate match Core · 3 min
  19. 19 XLOOKUP, the modern wayXLOOKUP Core · 3 min
  20. 20 Where is it in the list?MATCH Core · 3 min
  21. 21 INDEX and MATCH togetherINDEX + MATCH Advanced · 3 min
  22. 22 Catch the error, not the bugIFERROR Core · 3 min
  23. 23 Split first and last namesLEFT, MID + FIND Core · 3 min
  24. 24 Mistake hunt: #N/A everywhereFixing #N/A Core · 3 min
  25. 25 Mistake hunt: hard-coded numbersReferences instead of typed numbers Core · 3 min
  26. 26 Mistake hunt: numbers stored as textNumbers stored as text Core · 3 min

Pro · coming soon

From first formula to job-ready.

100+ challenges on lookups, pivot tables, dates and text cleanup, an interview track modeled on the Excel tests employers use, and your progress saved across devices.

$29 one-time · early-bird price

You won't be charged today.

You're early!

Pro isn't open yet. We're building it right now. Leave your email and we'll hold the $29 early-bird price for you and tell you the day it launches.

We'll email you a link to confirm, then one email when Pro launches. Privacy