+ Reply to Thread
Results 1 to 9 of 9

Using IF, AND, OR together

  1. #1
    Registered User
    Join Date
    06-26-2006
    Location
    New York
    MS-Off Ver
    Office Pro 2003 primarily, some 2007
    Posts
    85

    Using IF, AND, OR together

    Hi, I think this should be a fairly easy question. But I'm not sure how to search given that my keywords are all very common and short.

    I have two columns. First column contains either "P" or "N" second column contains a percentage (positive or negative value). In the third column I'd like to have the result be that IF "P" AND positive percent value, OR "N" AND negative percent value, THEN "Win", otherwise "Lose"

    The formula I've started looks like this:

    =IF(AND(S2>0,H2="P")*(OR(S2<0,H2="N")),"Win","Lose")

    Excel added in the "*" which I think is part of my problem, but I'm not sure on the syntax for adding in an AND statement and an OR statement together.

    Help is much appreciated.
    Last edited by dylanemcgregor; 06-17-2009 at 01:18 PM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078

    Re: Using IF, AND, OR together

    AND, ORs, EQUALs and NOT EQUALs are always a bit tricky. When describing the problem to others you really have to specify CLEARLY what you are after else you'll end up with the wrong results.

    Based on your second paragraph this would seem the correct formula:

    IF(OR(AND(S2>0,H2="P"),AND(S2<0,H2="N")),"Win","Lose")
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    06-26-2006
    Location
    New York
    MS-Off Ver
    Office Pro 2003 primarily, some 2007
    Posts
    85

    Re: Using IF, AND, OR together

    Thanks, this worked perfectly.

    I will try to be clearer in the future with any questions.

    Cheers,
    Dylan

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078

    Re: Using IF, AND, OR together

    Dont get me wrong, I wasnt complaining, your post was perfectly clear.
    Its just where AND/OR/NOT/EQUAL is concerned often the person wanting a solution doesnt state the conditions clearly. If only everyone stated things as clearly as you Glad to help.

  5. #5
    Registered User
    Join Date
    11-15-2009
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Using IF, AND, OR together

    I have a similar sounding question and cannot work out the formula I need and would welcome any help as it is driving me mad !?!?!?

    I have two columns (A and B) of numbers between 1 and 10. If a number in column A is <6 I label column D with "Low", otherwise "High", and if a number in Column B is <6 I label column E "Low", otherwise "High". I have done this with IF statements in columns D and E. I now want another dimension in column F which achieves the following :

    e.g.
    IF D1=LOW and E1=LOW then put "ABC" in F1 but if D1=HIGH and E1=HIGH then put "XYZ" in F1, but if D1=LOW and E1=HIGH then put "DEF" in F1, and finally if D1=HIGH and E1=LOW then put "MNO" in F1

    I hope that makes sense. Any help would be greatly appreciated

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Using IF, AND, OR together

    AJLowther,

    please take a moment to read the forum rules, and then please start your own thread. You are welcome to link to this thread if you feel this will help the contributors on this forum to solve your issue.

    cheers

  7. #7
    Registered User
    Join Date
    09-25-2014
    Location
    Delhi, India
    MS-Off Ver
    Microsoft Office 2010
    Posts
    1

    Re: Using IF, AND, OR together

    Hi Special-K
    Looks like you can solve this one as well.

    Reams Sheets
    400 1600
    500 680
    300 450

    Now one ream contains 500 sheets. In the third column I need a value in Reams and Sheets together in one place, which is for first row 403-100.

    I just can't figure out how to juggle IF, OR, AND to make it easier for me.
    Thanks in anticipation.
    Last edited by VISHWAJEET.SN; 09-26-2014 at 02:31 PM.

  8. #8
    Registered User
    Join Date
    08-24-2014
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: Using IF, AND, OR together

    to moderator -> Sorry for giving reply here. But the person will receive mail if i reply here. So, i had to.

    Vishwajeet,

    u can use formula
    Please Login or Register  to view this content.
    ☚ Don't forget to rate person who helped u Click ★

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,937

    Re: Using IF, AND, OR together

    VISHWAJEET.SN, xlrocks
    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    Ben Van Johnson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1