# Need Help with IF/AND/OR Function

1. ## Need Help with IF/AND/OR Function

Hi Folks,

Can Anyone Help me with getting this fixed in Excel? I tried the variations mention below and many more but all are getting error in excel.

=IF(AND C2="LONG", IF(P2>J2,"WIN","LOSS"), OR(C2="SHORT", (P2<J2,"WIN","LOSS")

=IF(AND(C2="LONG", P2>J2,)"WIN", IF(C2="LONG", P2<J2,)"LOSS", IF(AND(C2="SHORT", P2<J2,)"WIN",IF(C2="LONG", P2>J2,)"LOSS"

=IF(C2="LONG", (P2>J2, "WIN", IF(C2="LONG", ( P2<J2, "LOSS", IF(C2="SHORT", (P2<J2, "WIN", IF(C2="SHORT", P2>J2, "LOSS")))))))

This is for my trading journal. Basically what I need is If I am taking a buy(LONG) position, it should be a win if P2>J2. Similarly for a Sell(SHORT) position it should be a win if P2<J2. C2 has the type of the position LONG/SHORT.

Would be very thankful for any help.

3. ## Re: Need Help with IF/AND/OR Function

Attaching Sample Sheet

4. ## Re: Need Help with IF/AND/OR Function

Attached sheet

5. ## Re: Need Help with IF/AND/OR Function

Based on the description in post #1 it would seem that the formula could be:
Formula:
`Please Login or Register  to view this content.`

Note that we haven't been told what should happen if P2 = J2.
Let us know if you have any questions.

There are currently 1 users browsing this thread. (0 members and 1 guests)