Logical operations

Intermediate Google Sheets

Richie Cotton

Data Evangelist at DataCamp

The opposite of true

A B C
1 Value Command Result
2 TRUE =NOT(A2) FALSE
3 FALSE =NOT(A3) TRUE
Intermediate Google Sheets

This and that

A B C D
1 Value1 Value2 Command Result
2 TRUE TRUE =AND(A2, B2) TRUE
3 TRUE FALSE =AND(A3, B3) FALSE
4 FALSE TRUE =AND(A4, B4) FALSE
5 FALSE FALSE =AND(A5, B5) FALSE
Intermediate Google Sheets

One or the other

A B C D
1 Value1 Value2 Command Result
2 TRUE TRUE =OR(A1, B1) TRUE
3 TRUE FALSE =OR(A2, B2) TRUE
4 FALSE TRUE =OR(A3, B3) TRUE
5 FALSE FALSE =OR(A4, B4) FALSE
Intermediate Google Sheets

Summary

  • NOT() swaps TRUE and FALSE.
  • AND() returns TRUE when all inputs are TRUE.
  • OR() returns TRUE when any inputs are TRUE.
Intermediate Google Sheets

Let's get logical!

Intermediate Google Sheets

Preparing Video For Download...