# nested if questions

#### congokin

##### Board Regular
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

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")<>

Still not making any sense....Is that ALL of the statements ??

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

MAybe this then
Code:
``=IF(K2>Q2,"UpperWin",IF(M2 < R2,"LowerWin",IF(AND(K2>Q2,M2 < R2),"UpperWin-LowerWin",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"

but this is working
=IF(AND(K2>Q2,M2 < R2),"UpperWin-LowerWin",IF(K2>Q2,"UpperWin",IF(M2 < R2,"LowerWin",0)))
thanks again

The difference between the formulas, is simply which argument you wanted first ??

The difference between the formulas, is simply which argument you wanted first ??

yes, that is right...I was wrong in the order in my argument...thanks again...Problem solved

Replies
2
Views
438
Replies
26
Views
3K
Replies
6
Views
613
Replies
2
Views
482
Replies
3
Views
429

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.

### Which adblocker are you using?

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

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