SheetsLessons
Lesson 7 · Logic

AND, OR, NOT & XOR

Combine conditions with AND and OR in Google Sheets, and nest them inside IF. Interactive practice problems.

Task 1 of 5

An applicant is approved if they are at least 21 AND have a credit score of 650 or more. Return TRUE/FALSE in D2.

D2
fx

Tip: while typing a formula, click a cell or drag across cells to insert references. Press Enter to check, and Tab to accept a function suggestion.

Checking several conditions at once

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

AND returns TRUE only when every condition is TRUE. OR returns TRUE when at least one is.

On their own they return TRUE or FALSE. Their real power shows up inside IF:

=IF(AND(B2>=4, C2>=2), "Yes", "No")

Cells that already hold TRUE/FALSE (like checkboxes) can be passed straight in: =OR(B2>5, C2).

NOT and XOR

NOT flips a single TRUE/FALSE. XOR means "one or the other, but not both": it's TRUE when an odd number of its conditions are TRUE.