Nesting Issues

Joseph.Marro

Board Regular
Joined
Nov 24, 2008
Messages
153
Hello again,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
I swear this project is going to kill me! I have one super formula that has a group of nested functions. The formula is below and works as intended.<o:p></o:p>
<o:p></o:p>
=IF(A4="Y",IF(AND(OR(AU4="PASS",AU4="N/A"),OR(AX4="PASS",AX4="N/A")),IF(COUNTA(B4:C4,E4:J4,M4:N4)=10,IF(OR(AND(H4="UID2",ISBLANK(L4)),AND(E4="EMB",ISBLANK(Q4))),"FAIL: CONDITIONAL REQUIREMENTS NOT MET","INSERT NEXT FUNCTION"),"FAIL: MISSING REQUIRED FIELD"),"FAIL: ASSOCIATED RECORD FAILURE"),"INACTIVE")<o:p></o:p>
<o:p></o:p>
I wrote the next formula to be inserted at the IF FALSE section, labeled "INSERT NEXT FUNCTION' in the above formula. The formula below works as intended by itself.<o:p></o:p>
<o:p></o:p>
=IF(OR(AND(I4="LD",LEN(J4)=6,OR(LEFT(J4,1)="N",LEFT(J4,1)="V",LEFT(J4,1)="Q",LEFT(J4,1)="R"),ISNUMBER(RIGHT(J4,5)*1)),AND(I4="D",LEN(J4)=5)),"INSERT NEXT FUNCTION","FAIL: FIELD REQUIREMENTS NOT MET")<o:p></o:p>
<o:p></o:p>
However, when I combine the two I get an error as soon as I hit enter. The combined formula looks like this;<o:p></o:p>
<o:p></o:p>
=IF(A4="Y",IF(AND(OR(AU4="PASS",AU4="N/A"),OR(AX4="PASS",AX4="N/A")),IF(COUNTA(B4:C4,E4:J4,M4:N4)=10,IF(OR(AND(H4="UID2",ISBLANK(L4)),AND(E4="EMB",ISBLANK(Q4))),"FAIL: CONDITIONAL REQUIREMENTS NOT MET",IF(OR(AND(I4="LD",LEN(J4)=6,OR(LEFT(J4,1)="N",LEFT(J4,1)="V",LEFT(J4,1)="Q",LEFT(J4,1)="R"),ISNUMBER(RIGHT(J4,5)*1)),AND(I4="D",LEN(J4)=5)),"INSERT NEXT FUNCTION","FAIL: FIELD REQUIREMENTS NOT MET")),"FAIL: MISSING REQUIRED FIELD"),"FAIL: ASSOCIATED RECORD FAILURE"),"INACTIVE")<o:p></o:p>
<o:p></o:p>
The Formula is not greater than 1024 characters and less than 7 nested IF() statements. When I hit ok on the error screen the first LEFT() is highlighted. I don’t get why they work separately but not together. The second formula is just the IF FALSE portion of the previous IF() statement.<o:p></o:p>
<o:p></o:p>
Thank you,<o:p></o:p>
<o:p></o:p>
Joe<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
 
Last edited:

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.
This is not an issue with nested ifs. This is an issue with nested formulas. Excel 2003 can only support 7 levels of nested formulas (see this link for more info.) I beleive Excel 2007 supports more levels of nesting.

The reason the formula is failing at the Left functions is that it is the 8th nested function in your formula.

You are most likely going to have to re-write the formula to use two cells rather than one - half the formula in one cell the other half in the other.

Take care.

Owen
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,954
Members
449,096
Latest member
Anshu121

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