Results 1 to 7 of 7
  1. #1
    Lounger
    Join Date
    Jun 2001
    Location
    Burlington, Ontario, Canada
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IF AND OR (XP SP2)

    Brain fart! <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>
    I have 3 columns, Column A listing Customer #'s, column E listing product code and column F listing pricing code.

    I know I am close (then again self-doubt sinks in) but my syntax is off. I want to state that if one of 3 particular customers receive one particular product code, they get one specific price code.

    =if(OR(A1=123444, A1=234666, A1=345777), AND(E1="0410-E","01AA",0)

    So, if one of the three customers is entered and if it matches the corresponding product code, it gets that specific price code, else 0.

    Where is it wrong? What plain, normally quite evident piece of coding/syntax I am overlooking?
    Your kind and polite way of pointing the way without calling me a doufus outloud would be appreciated!

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: IF AND OR (XP SP2)

    Are you looking for this?

    <pre>=IF(AND(E1="0410-E",OR(A1=123444, A1=234666, A1=345777)),"01AA",0)</pre>


    Steve

  3. #3
    Lounger
    Join Date
    Jun 2001
    Location
    Burlington, Ontario, Canada
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF AND OR (XP SP2)

    <img src=/S/doh.gif border=0 alt=doh width=15 height=15>
    You see, I knew that banging my head against wasn't going to get the answer as quickly as asking the Loungers!

    I was sooo close.

    Thanks - it works great!

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: IF AND OR (XP SP2)

    Banging your head might not help, but don't you find that it feels good when you stop <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Steve

  5. #5
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF AND OR (XP SP2)

    Steve,

    And I was spinning my wheels trying to solve it with a formula using two VLOOKUP formulas.
    I am soooo glad I checked back to see if it was solved! Now I can stop that horrible approach.

    Chuck
    Chuck Reimer
    I'm from the Government and I'm here to help...

  6. #6
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: IF AND OR (XP SP2)

    Hi Chuck,

    You can even do it without the AND & OR statements:
    =IF((E1="0410-E")*((A1=123444)+(A1=234666)+(A1=345777)),"01AA",0 )

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  7. #7
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF AND OR (XP SP2)

    Macropod,
    Now that IS sweet! One of the things I enjoy about working in Excel is there are so many different ways to solve problems.

    Chuck
    Chuck Reimer
    I'm from the Government and I'm here to help...

Posting Permissions

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