Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
Please request help on the below issue.
I have 4 if statements below and t,I am not able to resolve it,please can anyone help me out???
i AM NOT GOOD IN NESTED IF'S SO PLEASE CAN SOMEONE HELP ME WITH THIS????????????
1)if( market_value_1<= strike_price,-1*(premium),((-1*(premium)+ (market_value_1-strike_price)))) and ([Buy/Sell]='BUY' AND xoptiontype='CALL'
2) if( market_value_1<= strike_price,+1*(premium),((+1*(premium)- (market_value_1-strike_price)))) and ([Buy/Sell]='SELL' AND xoptiontype='CALL'
3) if( market_value_1<= strike_price,((-1*(premium)+ (strike_price-market_value_1))),-1*(premium)) and ([Buy/Sell]='BUY' AND xoptiontype='PUT'
4) if( market_value_1<= strike_price,((+1*(premium)- (strike_price-market_value_1))),+1*(premium)) and ([Buy/Sell]='SELL' AND xoptiontype='PUT'
I HAVE ATTACHED THE FILE FOR REFERENCE.
In them the 4 columns buy_call,buy_put,sell_call and sell_put are differently displayed which needs to be combined to a single column with the extra contion for esch case:
([Buy/Sell]='BUY' AND xoptiontype='CALL' etc.. as shown above.
Hi Anbu
I will try to make it better for you ,probably my question was lil confusing to understand.
eg:
Condition 1
IF buy_sell = 'BUY' and xoptiontype_ = 'CALL' and market_value_1 <= strike_price
then it should show -1*(premium) else it should show its own else statement which is ((-1*(premium)+ (market_value_1-strike_price)) and then move to the next condition
the same thing for the rest of the conditions as well.
hence
buy/call
sell/call
buy/put
sell/put
should be iterated one after the other after it goes through its own conditions.
I wish this would explain my requirement better.
Try this and make sure to correct cases of buy_sell and xoptiontype_
=if( buy_sell = 'BUY' and xoptiontype_ = 'CALL', If(market_value_1 <= strike_price,-1*(premium),((-1*(premium)+ (market_value_1-strike_price))))
,if( buy_sell = 'sell ' and xoptiontype_ = 'call', If( market_value_1 <= strike_price,+1*(premium),((+1*(premium)- (market_value_1-strike_price))))
,if( buy_sell = 'buy ' and xoptiontype_ = 'put',
If(market_value_1 <= strike_price,((-1*(premium)+ (strike_price-market_value_1))),-1*(premium))
,if( buy_sell = 'sell ' and xoptiontype_ = 'put',
If(market_value_1 <= strike_price,((+1*(premium)- (strike_price-market_value_1))),+1*(premium))
,0)
)
))