Excel function reference

AND / OR / XOR / NOT

Quick answer

The boolean building blocks. Combine multiple TRUE/FALSE conditions into one, or flip a condition around.

AND(logical1, [logical2], ...) · OR(logical1, [logical2], ...) · XOR(logical1, [logical2], ...) · NOT(logical)

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

AND(logical1, [logical2], ...) · OR(logical1, [logical2], ...) · XOR(logical1, [logical2], ...) · NOT(logical)
ArgumentDescription
logical1Required. 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:

=IF(AND(B2>=3.5,C2>=90),"Eligible","Not eligible")

Either threshold alone isn't enough; AND only returns TRUE when both GPA and attendance clear their bar in the same row.

Worked examples

Every condition must hold
ABC
1StudentGPAAttendance %
2Maya3.792
=AND(B2>=3.5,C2>=90) → TRUE
Any one condition is enough
ABC
1DayRain %Wind (mph)
2Saturday3032
=OR(B2>50,C2>25) → TRUE
Exactly one, not both
AB
1Front (1=open)Back (1=open)
211
=XOR(A2=1,B2=1) → FALSE

(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 →