The Database Journal
03/10/2006
Adjusting Autonumber Increments

03/10/2006
Moving Access Data to Microsoft Excel

03/10/2006
Exporting Access Data with TransferSpreadsheet

03/10/2006
Export Access Data with VBA

03/13/2006
Data Layout in Microsoft Excel

03/17/2006
Excel Text to Number Conversion

03/21/2006
Transposing Excel Ranges

03/25/2006
Access VBA Timer Event

03/29/2006
What is MySQL?

04/02/2006
Microsoft Access Parameter Query Tutorial Video

04/06/2006
How does PHP Work?

04/10/2006
Microsoft Access VBA Tools - References

Click here to view all articles.

Database Design
Website Design
Search Engine Marketing
Home
Contact Us
About Us
Database Journal
Newsletters
Database Newsletter

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:

Figure 1

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:

=IF(A4>300,"Correct",IF(B4="Blue","Correct","Wrong"))

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

David Badurina, President of Blue Moose Technology, LLC, is a relational database design expert. David's unique ability to easily explain virtually any technical concept has allowed him to work with companies such as AMD, Motorola, the American Heart Association, and countless small businesses. Learn more about database design right now at http://www.bluemoosetech.com.

Article Publishing and Re-Print Guidelines

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:

Microsoft Excel OR Function