This week’s topic are the two logical functions AND and OR.
The past two week’s we’ve looked at the IF function and the IFERROR function. This post will finish up our “logical series” with two functions that aren’t very useful on their own, but can be very powerful when used within an IF function.
AND & OR are very similar. Essentially you feed these functions any number of logical tests and the function will return a TRUE or FALSE depending on the results of those tests.
When using the AND function it will return a TRUE if all of the tests are true. It will return a FALSE if any of the tests are false. Thus, you could have 10 tests that are true but if the 11th test is false then the result of the AND function will be FALSE.
The OR function works sort of opposite from the AND function. It will return TRUE if a single test is true. It will return a FALSE only if all of the tests are false. Thus, you could have 10 tests that are false, but if the 11th test is true then the result of the OR function will be TRUE.
Let’s look at some examples.
Below are some screenshots using the AND function. The formula is checking each row for equality. Using the AND function this means that all three lines must be equal for the formula result to be TRUE.
Now compare the above screenshots with the following ones using the OR function. Notice how even though some of the lines aren’t equal, as long as there is one line with equality the formula result is TRUE.
Finally, you can download this example spreadsheet to try out the above example and also give the advanced example a try. The instructions for the advanced example are contained within the spreadsheet.