Google Sheets Course: Comparison Operators

On the previous page, you were introduced to the first 2 comparison operators >= and <. Here's a list of other operators you can use:

=is equal to
<>is not equal to
<is less than
<=is less than or equal to
>is greater than
>=is greater than or equal to

The AND and OR functions

The AND function =AND(test_1, test_2, ...) returns TRUE if all tests are TRUE.

The OR function =OR(test_1, test_2, ...) returns TRUE if at least one of the tests is TRUE.

For example, if it's necessary to check IF the person is at least 18 years old AND less than 65 years old, the AND function will be useful:

=IF(AND(B2>=18,B2<65),"Yes","No")
google sheets function if and comparison operators

In this same case, it would also be possible to use the OR function to check if the person is outside the active age range:

=IF(OR(B2<18,B2>=65),"No","Yes")
google sheets function if or comparison operators

Exercise

Now import the file exercise-4.xlsx into a new spreadsheet.

Your sheet will look like this after the import:

google sheets exercise comparison operators

The objective of this exercise is to use the knowledge acquired in these first lessons to create the following table:

google sheets exercise order articles comparison operators

Start by formatting the table, apply the correct format to the data, and then calculate the missing values using formulas and functions (IF, SUM).