# Microsoft Office Application Help - Excel Help forum > Excel General >  >  Using IF, AND, OR together

## dylanemcgregor

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.

----------


## Special-K

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")

----------


## dylanemcgregor

Thanks, this worked perfectly.

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

Cheers,
Dylan

----------


## Special-K

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  :Smilie:  Glad to help.

----------


## AJLowther

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  :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

----------


## teylyn

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

----------


## VISHWAJEET.SN

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.

----------


## xlrocks

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

----------


## protonLeah

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.

----------

