More than 7 nested if loops.

zcemf64

New Member
Joined
Aug 3, 2011
Messages
10
Hey,

I am aware that excel does not allow more than 7 nested if loops. This is my current formula. I've just realized that my formula has to continue in this pattern up to 15 times. Any ideas on how to make it work?

=IF(AND(H3965>90,H3965<180,$O$2>0,$O$2<180,E3965>180,E3965<360),"TR1",(IF(AND(H3965>90,H3965<180),"TR",(IF(AND(H3965>0,H3965<90),"TL",(IF(AND(H3965>180,H3965<270,$O$2>0,$O$2<180,E3965>180,E3965<360),"BR1",(IF(AND(H3965>180,H3965<270),"BR",(IF(AND(H3965>270,H3965<360),"BL","")))))))))))
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I would probably go the custome function route. If you need help codeing I will be glad to help.
 
Upvote 0
You might be able to accomplish this using the =CHOOSE() function.

For example, if your formula just had 4 Outcomes for which quadrant the number of degrees represents, you could use:
=CHOOSE(TRUNC(H3965/90,0)+1,"TR","TL","BL","BR")

You could extend this to your other two Outcomes shown in your OP, if you can make a formula that will evaluate to 5 and 6 in this format...
=CHOOSE(TRUNC(H3965/90,0)+1+(1*expressionTR1isTrue)+(2*expressionBR1isTrue),"TR","TL","BL","BR","TR1","BR1")

or split into 2 or more sets of Choices....
=If(expressionX,CHOOSE(expression,"TR1","BR1"), CHOOSE(TRUNC(H3965/90,0)+1,"TR","TL","BL","BR"))

Depending on your pattern that repeats 15 times, the "expression" parts might be simple or nearly impossible. ;)

Good luck!
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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