View Single Post
  #1   Report Post  
carl
 
Posts: n/a
Default IF with AND and OR

My data looks like so:

ColA ColB ColC ColD ColE
Product Type Price1 Price2 Profit/Loss
Sell A 38.43 39.47 1.04
Buy A 38.43 39.47 -1.04
Sell B 38.43 39.47 -1.04
Buy B 39.42 39.47 0.05

I would like a formula in ColE (Profit/Loss) to follow this logic:

If Sell and A then D-C OR if Buy and A then C-D OR if Sell and B then C-D OR
if Buy and B then D-C

I've tried a few combo's but could not get the results as shown in the table
above.

Thank you in advance.