AND / OR / XOR / NOT
The boolean building blocks. Combine multiple TRUE/FALSE conditions into one, or flip a condition around.
Real eligibility rules almost never come down to one condition. A scholarship might need a GPA above a threshold and attendance above a threshold; a weather warning might trigger on heavy rain or high wind, whichever comes first. IF only ever tests one TRUE/FALSE value, so AND/OR/XOR/NOT exist to combine several conditions into the single test IF needs.
AND requires every condition to hold; OR requires at least one; XOR is true when an odd number of the conditions are true, which with exactly two conditions means exactly one of them, not "at least one." NOT simply flips a single condition's result.
Syntax
| Argument | Description |
|---|---|
| logical1 | Required. A condition that evaluates to TRUE or FALSE, e.g. B2>=60. |
| logical2, ... | Optional. More conditions. AND/OR/XOR accept up to 255. |
| (NOT) | NOT takes exactly one condition and returns its opposite. |
A real example: a scholarship that needs two conditions at once
Combined with IF, AND turns two separate thresholds into one eligible/not-eligible flag:
Either threshold alone isn't enough; AND only returns TRUE when both GPA and attendance clear their bar in the same row.
Worked examples
| A | B | C | |
|---|---|---|---|
| 1 | Student | GPA | Attendance % |
| 2 | Maya | 3.7 | 92 |
| A | B | C | |
|---|---|---|---|
| 1 | Day | Rain % | Wind (mph) |
| 2 | Saturday | 30 | 32 |
| A | B | |
|---|---|---|
| 1 | Front (1=open) | Back (1=open) |
| 2 | 1 | 1 |
(both open at once is not the flagged case; only one being open is)
Common mistakes
- Reaching for OR when the rule actually needs every condition to hold. That's AND.
- Assuming XOR works like "either one". With two conditions it specifically means exactly one, not "at least one" (that's OR).
- Writing =TRUE() when a plain =TRUE would do, or vice versa. LearnExcel (and Excel) accept both.
Related functions
Try it yourself
A free, graded practice exercise using this exact function: instant feedback, no signup required.
Practice AND / OR / XOR / NOT →