Microsoft Excel OR Function
Using OR With IF
OR functions work similarly to AND functions with the explicit difference that it returns true when ANY condition matches as opposed to needing ALL conditions to match.
For instance, we can use an OR function to return a value from an IF statement as long as it matches something in our IF statement’s condition. Figure 1 shows an example of using an OR statement within IF:
OR with IF
In this example, we’re trying to determine if the value in column A is over $300 OR if column B shows “Blue”. By using OR in your IF formulas you can effectively create conditional formulas for a wide range of possibilities.
Even if you need any one of five or ten possibilities in your OR formula, you can easily nest it within the condition of the IF statement to determine what you need. Don’t even try that with a standard IF function. To get this same result with only IF statements, you’d need something like this:
There’s really no comparison. Using the proper logical function like OR or AND within your IF statements makes them more readable, flexible, and easier to maintain.
©2010 Blue Moose Technology, LLC
Article Publishing and Re-Print Guidelines
- The article text, resource box, URLs copyright information and these guidelines must be left intact and unchanged.
- When re-published online, all links must be live hyperlinks.
- These articles may not be distributed in any manner that does not comply with federal communication guidelines. Be Good!
- These articles must not be password protected or limited to membership or paid-only viewing. Keep 'em free, folks!
You can easily link to this article!
If you'd like to link to this article from your own website, copy and paste the following HTML code onto your page:
On your page, the code will appear like this:


