Excel Tip of the Week: AND & OR

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.

About Doug Midkiff

I’m really good at Excel. I’m also a Texan, which seems to be a trend among OwenBloggers these days (you can’t stop us, you can only hope to contain us). After graduating from Texas, (Hook’em) I spent four years as a financial analyst before finding my way to Owen where I’m concentrating in finance with an emphasis on real estate. I love my wife, indie coffee shops, disc golf, soccer, web comics, Google maps, urbanism, sustainability, and warm weather.
This entry was posted in Doug Midkiff '12, Excel Tip of the Week and tagged AND, , logical, OR. Bookmark the permalink.

Leave a Reply