Sei sulla pagina 1di 2

10/8/13

Microsoft Excel Functions: IF, AND, OR

Microsoft Excel Function Combinations - IF, AND, OR


Using OR, AND & IF
We can combine both an OR and an AND function within an IF statement. By doing this, we can create some interesting conditional formulas to get even more out of our data. In Figure 1, weve added an additional column with a weekday to illustrate how you could use both an AND and OR function within an IF statement to really narrow down the type of value you get as a result:

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 03/25/2006
Figure 1

Transposing Excel Ranges Access VBA Timer Event


03/29/2006 04/02/2006

AND, OR with IF ...


Our formula for the calculations in column D is: = I F ( O R ( A N D ( A 1 > 3 0 0 , B 1 = " B l u e " ) , A N D ( A 1 < 3 0 0 , C 1 = " M o n d a y " ) ) , " C o r r e c t " , " W r o n g " ) What this formula is saying in plain English is, If A1 is over 300 and B1 is Blue, return Correct OR if A1 is less than 300 and C1 is Monday, return Correct. Otherwise, its Wrong! So as you can see from this example, using both an AND and OR within an IF statement can really help you create some very pointed formulas to get exactly what you need out of your data from a conditional standpoint. Curious as to what this would look like if it was just IF formulas? = I F ( A 1 > 3 0 0 , I F ( B 1 = " B l u e " , " C o r r e c t " , " W r o n g " ) , I F ( C 1 = " M o n d a y " , " C o r r e c t " , " W r o n g " ) ) Using OR and AND only has 5 less characters than using just IF statements, but the space youre saving isnt the concern here. What is of concern is the readability and flexibility of your formula. By far, using AND and OR in conjunction with IF is a more desirable way to write your statement because if you need to add a condition or remove a condition, you dont need to restructure or re-write the entire formula to do it. Plus, its just much easier to understand! 2013 Blue Moose Technology, LLC

What is MySQL? Microsoft Access Parameter Query Tutorial Video


04/06/2006 04/10/2006

How does PHP Work? Microsoft Access VBA Tools - References

Click here to view all articles.

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


www.bluemoosetech.com/microsoft-excel-functions.php?jid=19& 1/2

10/8/13

Microsoft Excel Functions: IF, AND, OR


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: < ah r e f = " h t t p : / / w w w . b l u e m o o s e t e c h . c o m / a r t i c l e . p h p ? j i d = 1 9 " > M i c r o s o f tE x c e l F u n c t i o nC o m b i n a t i o n s-I F ,A N D ,O R < / a >

On your page, the code will appear like this: Microsoft Excel Function Combinations - IF, AND, OR

2008 Blue Moose Te chnology, LLC All rights re se rve d.

www.bluemoosetech.com/microsoft-excel-functions.php?jid=19&

2/2

Potrebbero piacerti anche