View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Ron@Buy Ron@Buy is offline
external usenet poster
 
Posts: 345
Default IF Statement (AND/OR)

In answer to your second problem, your FALSE statement can be replaced with a
blank using:
=IF(AND(B5="Sell",F50),F5+0.005,IF(AND(B5="Buy",F 50),F5-0.005,""))


"Ron@Buy" wrote:

I think this may give you what you want:
=IF(AND(OR(B5="Buy",B5="Sell"),I5="-"),(G5-F5)*E5*1000,IF(AND(B5="Buy",I5="+"),(H5-F5)*E5*1000,IF(AND(B5="Sell",I5="+"),(F5-H5)*E5*1000,"")))
But I'm sure there is a more compact formula in there somewhere.
(Why multiply E5 by 1000 in the formula, why not just enter your data with
three 0s or custom format the cell?)


"Mukesh" wrote:


I want is :
IF B5="buy" & I5="+" ..result (H5-F5)*E5*1000
IF B5="buy" & I5="-" ..result (G5-F5)*E5*1000
IF B5="sell" & I5="+" ..result (F5-H5)*E5*1000
IF B5="sell" & I5="-" ..result (G5-F5)*E5*1000

I tried following code, it works well, but when I add same for "sell", it
doens't work,
please correct me.

=IF(AND(B5="buy",I5="+"),(H5-F5)*E5*1000,IF(AND(B5="buy",I5="-"),(G5-F5)*E5*1000))

I am getting FALSE instead of blank field, where am I wrong.
=IF(B5="sell",IF(F50,F5+0.005," "),IF(B5="buy",IF(F50,F5-0.005," ")))

Thanks.
Mukesh