How to use the AND and OR functions in Google Sheets

The logical functions AND and OR give you TRUE and FALSE responses, which you can use to organize your data. You can use AND and OR separately or together with other functions, such as IF.

If you ever want to check if your Google Sheets spreadsheet data meets certain criteria, you can use the AND and OR functions. These logical functions provide you with TRUE and FALSE responses, which you can use to organize your data.

If you use AND with multiple arguments, all of those arguments must be true for a TRUE response; otherwise, the AND function will return FALSE results. If you use OR, only one of the correct arguments, the OR function, will provide the TRUE response.

You can use AND and OR separately or together with other functions, such as IF.

Use the AND function in Google Sheets

You can use the AND function yourself or in combination with other functions to provide a logical test (TRUE or FALSE).

To get started, open Google Sheets and click a blank cell. Import:

=AND(Argument A, Argument B)

Replace each argument with the criteria you want to use. You can use as many arguments as you want, but you must have at least one argument for AND to work.

In the example below, the article used 3 arguments:

  1. The first argument is the simple calculation 1 + 1 = 2 .
  2. The second argument indicates that cell E3 is equal to 17.
  3. Finally, the third argument indicates that the value of cell F3 (is 3 ) is equal to the calculation 4-1.

Because all three arguments are correct, the AND formula returns TRUE in cell A2. If any of these arguments are changed, it will cause the AND formula in A2 to change the response from TRUE to FALSE.

How to use the AND and OR functions in Google Sheets Picture 1How to use the AND and OR functions in Google Sheets Picture 1 The AND formula returns TRUE in cell A2

In the example below, the AND formula in cell A3 has two correct arguments and one is incorrect ( F3 = 10 , while F3 is actually equal to 3 ). This causes the AND function to give FALSE feedback.

How to use the AND and OR functions in Google Sheets Picture 2How to use the AND and OR functions in Google Sheets Picture 2 The AND function gives a FALSE response

Use the OR function in Google Sheets

While AND requires all the arguments it uses to be true, OR requires only one argument to be true to give TRUE feedback.

Like AND, you can use the OR function alone or combine it with other functions. As with AND, you can use as many arguments as you want, but you must have at least one argument for the function to work.

To use OR, click a blank cell and enter:

=OR(Argument A, Argument B)

Replace with your arguments.

In the example below, the formula using OR in cell A2 has an incorrect argument ( F3 = 10 , where F3 is actually equal to 3 ).

Unlike when you use AND, one of the three incorrect arguments still results in TRUE. For FALSE results, all arguments you use must be incorrect.

How to use the AND and OR functions in Google Sheets Picture 3How to use the AND and OR functions in Google Sheets Picture 3 One of the three incorrect arguments still gives TRUE results

In the example below, the OR formula in cells A4 and A5 returns the FALSE response, because all three arguments in the two formulas are incorrect.

How to use the AND and OR functions in Google Sheets Picture 4How to use the AND and OR functions in Google Sheets Picture 4 The OR formula in cells A4 and A5 returns the FALSE response

Use AND and OR with IF

Because AND and OR are logical functions with TRUE and FALSE responses, you can also use them with IF. When you use IF, if an argument is TRUE, it will return a value, otherwise the function will return another value.

The format of the formula using IF is:

=IF(Argument, Value IF TRUE, Value IF FALSE)

For example, as shown below, = IF (E2 = 1,3,4) causes IF to return 3 , if cell E2 equals 1 ; otherwise it returns 4 .

How to use the AND and OR functions in Google Sheets Picture 5How to use the AND and OR functions in Google Sheets Picture 5 = IF (E2 = 1,3,4) causes IF to return 3, if cell E2 equals 1

Because IF only supports a single argument, you can use AND and OR to perform complex logical tests with multiple arguments.

Use AND with IF

To use AND in an IF formula, enter:

=IF(AND(AND Argument 1), Value IF TRUE, Value IF FALSE)

In the example below, the article used IF with the same AND formula nested in cell A2 with 4 arguments. All 4 arguments are true, so the IF TRUE value (in this case, Yes ) is returned.

How to use the AND and OR functions in Google Sheets Picture 6How to use the AND and OR functions in Google Sheets Picture 6 All 4 arguments are true, so the IF TRUE (Yes) value is returned

In cell A3, an IF formula similar to AND contains two incorrect arguments. Because AND requires all arguments to be correct, IF returns the IF FALSE value , which is a different text value ( No ).

Use OR with IF

As with AND, you can also use OR with IF to create a complex logical test. Only one OR argument must be correct for IF to return a TRUE response.

To use OR with IF, click a blank cell and enter:

=IF(OR(OR Argument 1), Value IF TRUE, Value IF FALSE)

Replace with the OR argument (s) and your IF TRUE / FALSE value.

In the examples below, the two IF formulas with OR in cells A2 and A3 return the text value IF TRUE ( Yes ). All 4 arguments are true in the A2 IF formula with OR, while A3 has 2 of 4 incorrect arguments.

How to use the AND and OR functions in Google Sheets Picture 7How to use the AND and OR functions in Google Sheets Picture 7 Two IF formulas with OR in cells A2 and A3 return the text value IF TRUE (Yes)

In cell A4, all 4 arguments in an IF formula with OR are incorrect. This is why the IF formula returns the IF FALSE ( No ) text value instead.

5 ★ | 1 Vote