# Thread: IF AND OR (XP SP2)

1. ## 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. ## 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. ## 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. ## 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. ## 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

6. ## 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

7. ## 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

#### Posting Permissions

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