+ Reply to Thread
Results 1 to 6 of 6

Syntax for 2 AND conditions within an OR function.

  1. #1
    Mike K
    Guest

    Syntax for 2 AND conditions within an OR function.

    Greetings all,

    I'm close, I think.
    I need to OR two AND conditions. The 60/45 and 12/40 are text formatted

    A1 A2
    "60/45" AND "Green"
    OR
    A1 A2
    "12/40" AND "Red"

    True = YES
    False = NO

    Thanks Folks!

    Mike

  2. #2
    Duke Carey
    Guest

    RE: Syntax for 2 AND conditions within an OR function.

    =if(or(and(a1="60/45" ,a2= "Green"),and(a1="12/40",a2= "Red")),"yes","no")


    "Mike K" wrote:

    > Greetings all,
    >
    > I'm close, I think.
    > I need to OR two AND conditions. The 60/45 and 12/40 are text formatted
    >
    > A1 A2
    > "60/45" AND "Green"
    > OR
    > A1 A2
    > "12/40" AND "Red"
    >
    > True = YES
    > False = NO
    >
    > Thanks Folks!
    >
    > Mike


  3. #3
    Bob Phillips
    Guest

    Re: Syntax for 2 AND conditions within an OR function.

    or

    =IF(OR(A1&A2="60/45Green",A1&A2="12/40Red"),"yes","no")

    --
    HTH

    Bob Phillips

    "Duke Carey" <[email protected]> wrote in message
    news:[email protected]...
    > =if(or(and(a1="60/45" ,a2= "Green"),and(a1="12/40",a2= "Red")),"yes","no")
    >
    >
    > "Mike K" wrote:
    >
    > > Greetings all,
    > >
    > > I'm close, I think.
    > > I need to OR two AND conditions. The 60/45 and 12/40 are text formatted
    > >
    > > A1 A2
    > > "60/45" AND "Green"
    > > OR
    > > A1 A2
    > > "12/40" AND "Red"
    > >
    > > True = YES
    > > False = NO
    > >
    > > Thanks Folks!
    > >
    > > Mike




  4. #4
    Harlan Grove
    Guest

    Re: Syntax for 2 AND conditions within an OR function.

    Bob Phillips wrote...
    >or
    >
    >=IF(OR(A1&A2="60/45Green",A1&A2="12/40Red"),"yes","no")

    ....
    >"Duke Carey" <[email protected]> wrote in message
    >>=if(or(and(a1="60/45" ,a2= "Green"),and(a1="12/40",a2= "Red")),"yes","no")

    ....

    In this particular case concatenation works, but it isn't reliable in
    general.


  5. #5
    Bob Phillips
    Guest

    Re: Syntax for 2 AND conditions within an OR function.

    Harlan,

    Are you referring to numbers?>

    Bob

    "Harlan Grove" <[email protected]> wrote in message
    news:[email protected]...
    > Bob Phillips wrote...
    > >or
    > >
    > >=IF(OR(A1&A2="60/45Green",A1&A2="12/40Red"),"yes","no")

    > ...
    > >"Duke Carey" <[email protected]> wrote in message
    > >>=if(or(and(a1="60/45" ,a2= "Green"),and(a1="12/40",a2=

    "Red")),"yes","no")
    > ...
    >
    > In this particular case concatenation works, but it isn't reliable in
    > general.
    >




  6. #6
    Harlan Grove
    Guest

    Re: Syntax for 2 AND conditions within an OR function.

    Bob Phillips wrote...
    >Are you referring to numbers?

    ....

    No. The result of the concatenation operator, &, is always text.

    But the point is that using OR(x&y="foobar",x&y="doodah") when the
    fully qualified test is OR(AND(x="foo",y="bar"),AND(x="doo",y="dah"))
    can lead to error when, e.g., x = "foob" and y = "ar" or x = "do" and y
    = "odah". IOW, x&y=A&B doesn't necessarily give the same result as
    AND(x=A,y=B).


+ 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