ExcelTip.com
ExcelTip.com
Account Icon Account Icon Account Icon
Google Exceltip.com
JOIN OUR NEWSLETTER
  and receive for joining:
Free eBook Learn More!
Free Excel ADD-IN
Free Weekly Excel Tip
4 e-books in cd-rom
F1 Formulas & Functions
F1 Formulas & Functions
F1 EXCEL
F1 eBook (Spanish)
F1 EXCEL
Financial Statements.xls
 

» Nesting OR & AND Functions to Meet Multiple Criteria
Problem:

We want to create a formula that returns "1" if Num1=10 and either Num2=5 or Num3=2.
Otherwise, the formula is to return "0".

Solution:
Use the IF, AND, and OR functions as shown in the following formula:
=IF(AND(A2=10,OR(B2=5,C2=2)),1,0)

Rate this tip
12 34 5
  RATING: 3.02
  VIEWS: 30827

READER COMMENTS (view all comments)


Help with IF
Rhea wrote on December 31, 1969 19:00 EST
Could someone please tell me what I am doing wrong with this formala? Each if argument work individually but not combined. Please help!!

IF(AND((AB7-AB5)>0,(((AB7-AB5)-((AB7-AB5)*22.5%))/AB5)>AB13),((AB7-AB5)*22.5%)+((((((AB7-AB5)-((AB7-AB5)*22.5%))/AB5)-AB13)*10%)*AB5)),IF(AND((AB7-AB5)>0,(((AB7-AB5)-((AB7-AB5)*22.5%))/AB5)<AB13),((AB7-AB5)*22.5%))
Help with IF
Rhea wrote on December 31, 1969 19:00 EST
Could someone please tell me what I am doing wrong with this formala? Each if argument work individually but not combined. Please help!!

IF(AND((AB7-AB5)>0,(((AB7-AB5)-((AB7-AB5)*22.5%))/AB5)>AB13),((AB7-AB5)*22.5%)+((((((AB7-AB5)-((AB7-AB5)*22.5%))/AB5)-AB13)*10%)*AB5)),IF(AND((AB7-AB5)>0,(((AB7-AB5)-((AB7-AB5)*22.5%))/AB5)<AB13),((AB7-AB5)*22.5%))

alizok wrote on January 30, 2006 15:00 EST
If i'm not mistaken the reason it doesn't work is because excel accepts only 8 if then statements. :mad:
None
Guest wrote on December 31, 1969 19:00 EST
You wrote If, but didn't finish your If, but nothing for the if. The whole point of an IF, is to have a Then or Else for your boolean statement. I believe you would need an Else or a "Then" to complete your statement. You may need to break these down into several If thens, nesting the statements.
Please help IF function
Sherly wrote on December 31, 1969 19:00 EST
Could someone please tell me what am I doing wrong with this formula? The returns I get are all "DIRECT", even there is "DOMAIN" or "NON-DOMAIN" in the column A .

IF(AND(A2="DOMAIN",OR(A2="NON-DOMAIN"),A2,"DIRECT")

Is there any formula that I can substitute?

My Problem is :
I want to create a formula that returns to its original value if the range of data in column A="DOMAIN" or "NON-DOMAIN"

Otherwise, the formula is to return "DIRECT"
multiple if & and statements
fresh33308 wrote on April 19, 2006 00:21 EST
Using a 2 by 4 matrix, I am having a problem making the formula work and am looking for ideas.

A1 B1 answer
0 --- 1 --- c6*4+2
0 --- 2 --- 0
1 --- 1 --- c6*2+1
1 --- 2 --- 0

=if(and(a1<1,b1<2,c6*4=2,if(and(a1>0,b1<2,C6*2+1,0)))

Simplifying anything in b1 over one = 0 reduces the work however I don't remember if you can use the , for otherwise 0. It has been a long time since I used these and if positioning is different these days. The excel help uses a data base which is not helpful.

Any Ideas? Mail to [email]fresh33308@yahoo.com[/email]

PS I know it is somethin simple but altimerz is setting in - OR - I think so?

thanks
If then
Barry Farmer wrote on December 31, 1969 19:00 EST
I want to put a formula in a spread sheet that if block f5 is equal to or higher than 20% of block b4 then block d3 * .0 if less than then * by .0078
Nested IF function
ajones wrote on July 12, 2006 15:59 EST
Grade Card:

Students are given bonus points/penalty depending on homework rating. See below:

Good 4 pts
OK 2 pts
Poor -2 pts

I need to utlize a nested IF function to complete it but I can't totally figure it out. Can you help?
Nest If statment
alizok wrote on August 07, 2006 13:53 EST
all you need to say is this:

If(A1="Good",4,if(A1="OK",2,2)) another way of write it
IF(OR(B10="Poor",B10="OK"),2,4)

hope it helps
Need Help On If Function, Tricky
Snooza35 wrote on December 31, 1969 19:00 EST
Hello I Am quite new to this all so need help plz.

ok i am in need of assisstance.
i want my cell to be blank if no feedback is given and to be correct or in correct depending on the answer.

My Formula:
=IF(B2="","")=IF(B2=C2,"correct")

but in my cell it keeps coming up witih FALSE

if u can help it will be much aprriciated thnx

also email me @ Roland_de_souza@hotmail.co.uk
HELP Please
elizabeth wrote on December 31, 1969 19:00 EST
I need to create a formula that will tell me how many times "m" appears in column l AND "u" appears in column p. The same goes for "f" in l and "u" in p.
I am trying to find the number of unemployed males and the number of unemployed females in our database.
Can someone help me compare 2 lists?
wendywithsmb wrote on February 06, 2007 17:22 EST
Help- I have 2 very long lists ( a small sample is attached ) and I want to compare them using DUNs and GUD #s; and ultimately populate the list of countries from the first list, into the second list. HELP...I figured it's an IF statement with a range, ie: IF (F2=C2:C9)OR(F2=D2:D9),"no match", what goes here?)
I can't get it to put the corresponding country from the matched cell into that box.

HELPPPPPP
thanks
A B C D E F G
Account Name Country Global Ulti DUNS # DUNS # Account list #2 DUNS or GUD # Country
Fidelity Brokerage Services, Inc United States 95856332 125223706 Ernst & Young LLP 181271339
Ernst & Young LLP United States 58369562 181271339 United Parcel Service, Inc. 13114066
Lockheed Martin Corporation - MD India 834951691 16913048 Nova Technology, Inc. 139622567
Milliken & Company Pakistan 2017440 2017440 Fidelity Brokerage Services, Inc 125223706
Ernst & Young LLP United States 2508463 2508463 Lockheed Martin Corporation - MD 834951691
United Parcel Service, Inc. United States 6991681 13114066 United States Patent and Trademark Office 72532075
Nova Technology, Inc. United States 139622567 Fidelity Brokerage Services, Inc 95856332
United States Patent and Trademark Office United States 72532075 Milliken & Company 2017440
Need help in if funtion!
ramanan wrote on February 19, 2007 02:16 EST
can some one help me?

i am in the sutuation to use more than 7 nested if in a formula, excel does not accept more than 7 nested loops, how can i avoid nested loops?
combination of IF,OR,ISERROR,ISBLANK formula
emai wrote on May 23, 2007 22:39 EST
good day! i just wana ask some help regarding with our school requirement about functions.the problem is.."we are going to get the time difference of a paticular hour worked by an employee using the combination of if,or,iserror,isblank formula"wat will be the formula with this?for example,timein-8:00am,timeout-5:00pm.wat will be the formula to get the time differnce using the combination of the 4 functions?thanks..



REGISTERED USERS - Click here to post comments


GUESTS (Click here to register)
Name
Comment Title
Comments

Wall Street Journal Guide to Understanding Money and Investing

F1 Get the Most out of Excel! The Ultimate Excel tip Help Guide

Finance and Accounting for Nonfinancial Managers

Mortgages For Dummies®

Rich Dad, Poor Dad: What the Rich Teach Their Kids About Money--That the Poor and Middle Class Do Not!

Definitive Guide to Excel VBA

RELATED MICROSOFT EXCEL TIPS


Convert PDF Files to Excel






Excel VBA books
Accounting books
Business Plans
MS Office books
Taxes books

VIEW ALL BOOKS


  Advertise With Us                               

Tips

Add-In in VBA | Applications - Word, Outlook in VBA | Array Formulas | Cells, Ranges, Rows, and Columns in VBA | Counting | Custom Functions | Custom Functions in VBA | Database Formulas | Database in VBA | Date & Time Formulas | Date & Time in VBA | Events in VBA | Excel 2003 | Excel Chart | Excel Consolidating | Excel Counting | Excel Custom Functions using VBA | Excel Customizing | Excel Data | Excel Dates | Excel Editing | Excel Files | Excel Filter | Excel Format | Excel Formula | Excel General | Excel Grouping and Outlining | Excel Importing Text Files | Excel Information | Excel Keyboard Shortcuts | Excel Loan Formulas | Excel Macros - VBA | Excel Pivot Tables | Excel Printing | Excel Range Name | Excel Security - Protection | Excel Sorting | Excel Style | Excel Subtotals | Excel Summing | Excel Text | Excel Time | Excel Tools | Excel Worksheet, Workbook | Files, Workbook, and Worksheets in VBA | Financial Formulas | Formating in VBA | General Topics in VBA | Import and Export in VBA | Information Formulas | Keyboard & Other Shortcuts in VBA | Keyboard Formula Shortcuts | Links between Worksheet and Workbooks | Links in VBA | Logical Formulas | Lookup Formulas | Mail - Send and Receive in VBA | Menus, Toolbars, Status bar in VBA | Modules, Class Modules in VBA | Other Q&A Formulas | Printing in VBA | Protecting in VBA | Summing | Text Formulas | User Forms, Input boxes in VBA | Using Loops | Working with Formulas |

Tips by Version

Microsoft Excel 97 | Microsoft Excel 2000 | Microsoft Excel 2002 | All Microsoft Excel Versions | New in Excel 2002 | New in Excel 2003 - Office 11

Website

Home | Tip of Hour | Recommended Tips | Most Viewed Tips | Tips by Version | Submit a Tip | My Tips
Microsoft Excel Tutorials | Excel Links | Write for Us | About Us | Search Results | Tip Archives | Excel Forum | Excel Forum Archives

Excel Book

Excel 97 Book | Excel 2000 Book | Excel 2002 Book | Excel XP Book | Book Store

Terms and Conditions of use
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Copyright © 2003 ExcelTip.com
Microsoft, Microsoft Excel is a U.S. registered trademark of Microsoft Corporation
Site Developed By: Varien