nested if questions

congokin

Board Regular
Joined
Oct 31, 2010
Messages
74
how can i combine these 3 if statements into 1

<r2),"lowerwin","0")
<r2),"lowerwin","0")
<r2)),"upperwin-lowerwin","0")<r2)),"upperwin-lowerwin","0")
=if((k2>q2),"UpperWin","0")

=if((m2<r2),"LowerWin","0")

=if(and(k2>q2), and(m2<r2)),"UpperWin-LowerWin","0")


</r2)),"upperwin-lowerwin","0")<r2)),"upperwin-lowerwin","0")
</r2),"lowerwin","0")
</r2),"lowerwin","0")
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Your 3rd statement is incomplete...if you are using < or > signs put a space between each one before posting
 
Upvote 0
2nd statement
if((m2 < r2),"LowerWin","0")

3rd statement
if(and(k2 > q2), and(m2 < r2)),"UpperWin-LowerWin","0")<r2),"lowerwin","0")< html=""></r2),"lowerwin","0")<>
 
Upvote 0
Still not making any sense....Is that ALL of the statements ??
 
Upvote 0
basically this is a bracket trade.
if the high of today (k2) is higher then the upper boundary of the bracket (q2) = Win
if the low of today (m2) is lower than lower boundary of the bracket (r2) = Win
if the high of today is higher of then the upper boundary of the bracket trade + if the low of today is lower than lower boundary of lower Trade = Win

I have each statement in 3 different col but want to have them in 1
 
Upvote 0
MAybe this then
Code:
=IF(K2>Q2,"UpperWin",IF(M2 < R2,"LowerWin",IF(AND(K2>Q2,M2 < R2),"UpperWin-LowerWin",0)))
 
Upvote 0
MAybe this then
Code:
=IF(K2>Q2,"UpperWin",IF(M2 < R2,"LowerWin",IF(AND(K2>Q2,M2 < R2),"UpperWin-LowerWin",0)))


thanks Michael M, but the formula does not work quite right
IF(AND(K2>Q2,M2 < R2),"UpperWin-LowerWin" - this part does not give me "UpperWin-LowerWin"
 
Upvote 0
but this is working
=IF(AND(K2>Q2,M2 < R2),"UpperWin-LowerWin",IF(K2>Q2,"UpperWin",IF(M2 < R2,"LowerWin",0)))
thanks again
 
Upvote 0
The difference between the formulas, is simply which argument you wanted first ??
 
Upvote 0

Forum statistics

Threads
1,202,905
Messages
6,052,473
Members
444,584
Latest member
gsupike

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top