Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: 2 conditionals and or statement

  1. #1
    Board Regular
    Join Date
    Nov 2012
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default 2 conditionals and or statement

    How can i write a formula for the following; if AB15="north" and AX<90 then "north" if false "south" OR if AB15="south" and AX<90 then "south" if false "north"

    The formula first needs to first needs to check whether AB15 is north or south and then the second condition.

  2. #2
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    84,915
    Post Thanks / Like
    Mentioned
    43 Post(s)
    Tagged
    8 Thread(s)

    Default Re: 2 conditionals and or statement

    Try rather to describe the problem instead of suggesting a solution or a formula...

    When AB15 = north and AX15 < 90 --> north
    When AB15 = south and AX15 < 90 --> south

    What must happen when AB15 = north or south and AX15 >= 90 ?
    What must happen when AB15 is neither north or south?
    Assuming too much and qualifying too much are two faces of the same problem.

  3. #3
    Board Regular
    Join Date
    Nov 2012
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: 2 conditionals and or statement

    Sorry, i wasn't trying to make a suggestion I was trying to describe the logic. AB15 will always be north or south and that is what the second condition is based on. That's why i said it needs to check first whether it is north or south. Sorry for the confusion....
    Quote Originally Posted by y3tter View Post
    if AB15="north" and AX<90 then "north" if false "south" OR if AB15="south" and AX<90 then "south" if false "north"

    The formula first needs to first needs to check whether AB15 is north or south and then the second condition.
    Quote Originally Posted by Aladin Akyurek View Post
    Try rather to describe the problem instead of suggesting a solution or a formula...

    When AB15 = north and AX15 < 90 --> north
    When AB15 = south and AX15 < 90 --> south

    What must happen when AB15 = north or south and AX15 >= 90 ?
    What must happen when AB15 is neither north or south?
    Last edited by y3tter; Dec 13th, 2014 at 02:42 PM.

  4. #4
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    84,915
    Post Thanks / Like
    Mentioned
    43 Post(s)
    Tagged
    8 Thread(s)

    Default Re: 2 conditionals and or statement

    Try to answer the questions though...
    Assuming too much and qualifying too much are two faces of the same problem.

  5. #5
    Board Regular
    Join Date
    Nov 2012
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: 2 conditionals and or statement

    I did in OP and I bolded it in the reply.

    What must happen when AB15 = north or south and AX15 >= 90 ? IF AB15 is north and AX15 is greater then "south" IF AB15 is south and AX15 is greater then "north
    What must happen when AB15 is neither north or south?It will always be either north or south, that's why i wrote it must check that value first

  6. #6
    MrExcel MVP mikerickson's Avatar
    Join Date
    Jan 2007
    Location
    Davis CA
    Posts
    22,259
    Post Thanks / Like
    Mentioned
    17 Post(s)
    Tagged
    10 Thread(s)

    Default Re: 2 conditionals and or statement

    I looks like

    =IF(OR(AND(AB15="north", AX<90), NOT(AND(AB1="south", AX<90))), "north", "south")

  7. #7
    Board Regular
    Join Date
    Nov 2012
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: 2 conditionals and or statement

    Quote Originally Posted by mikerickson View Post
    I looks like

    =IF(OR(AND(AB15="north", AX<90), NOT(AND(AB1="south", AX<90))), "north", "south")
    Great!!!! Thank you so MUCH!!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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