AND, OR & XOR practice exercises
5 graded problems with realistic data, from easy to medium.
The boolean building blocks. Combine multiple TRUE/FALSE conditions into one, or flip a condition around. The 5 exercises below come from LearnExcel's practice library. Each one gives you a realistic table, a cell to fill, and a hint if you get stuck. Read them here, then solve them in the interactive grid, where your formula is checked the moment you press Enter.
New to the function? Read the AND, OR & XOR guide first: syntax, a worked example and the mistakes people make.
In this set
- Flag scholarship eligibility
- Flag whether the trip needs a rain plan
- Flag an unusual door state
- Flag whether a support ticket is still open
- Set a manual unavailable flag during audit
The exercises
The merit scholarship requires a GPA of 3.5 or higher AND attendance of 90% or higher. Check whether Maya qualifies.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Student | GPA | Attendance % | Eligible |
| 2 | Maya | 3.7 | 92 | ? |
Enter a formula in D2.
Show a hint
AND(condition1, condition2) is true only when every condition is true: =AND(B2>=3.5,C2>=90).
AND is how a spreadsheet enforces "all of these must hold." Eligibility rules almost always stack more than one requirement.
The hiking club needs a backup plan if the rain chance is above 50% OR wind speed is above 25 mph. Check Saturday.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Day | Rain % | Wind (mph) | Rain Plan? |
| 2 | Saturday | 30 | 32 | ? |
Enter a formula in D2.
Show a hint
OR(condition1, condition2) is true if at least one condition is true: =OR(B2>50,C2>25).
OR is for "any one of these is enough." Trip planning, alerts, and approvals all lean on this pattern.
A store's security system should flag an alert only when exactly one of the two doors is open. Both closed or both open is normal during restocking. Check the current state.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Store | Front Door (1=open) | Back Door (1=open) | Alert? |
| 2 | Store #12 | 1 | 0 | ? |
Enter a formula in D2.
Show a hint
XOR(condition1, condition2) is true only when exactly one side is true, not both, not neither: =XOR(B2=1,C2=1).
XOR is the "exactly one, not both" logic, useful whenever two states should normally move together and a mismatch is what matters.
The Closed column uses 1 for closed and 0 for still open. Check whether ticket #552 is still open.
| A | B | C | |
|---|---|---|---|
| 1 | Ticket | Closed (1=yes) | Open? |
| 2 | #552 | 0 | ? |
Enter a formula in C2.
Show a hint
NOT(condition) flips a condition's result: =NOT(B2=1).
NOT is handy for reading a flag "backwards," turning a Closed column into an Open one without adding a new source column.
The warehouse is doing a full inventory audit this week, so every item should show as unavailable for order no matter what the stock count says. Hardcode the Available flag for this item.
| A | B | C | |
|---|---|---|---|
| 1 | Item | Stock | Available for order? |
| 2 | Gadget | 42 | ? |
Enter a formula in C2.
Show a hint
TRUE and FALSE are literal boolean values you can type directly. No cell reference needed: =FALSE (or =FALSE()).
Sometimes a flag needs to be a fixed override rather than the result of a calculation. TRUE/FALSE literals do that directly.
Solve these in a real grid
Type your formula, get graded instantly. Your first 10 exercises are free, no signup.
Start the AND, OR & XOR exercises →