more levels of nesting than allowed in a formula

Pursuit2010

New Member
Joined
Oct 20, 2010
Messages
7
<TABLE style="WIDTH: 581pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=773><COLGROUP><COL style="WIDTH: 48pt" span=2 width=64><COL style="WIDTH: 58pt; mso-width-source: userset; mso-width-alt: 2816" width=77><COL style="WIDTH: 59pt; mso-width-source: userset; mso-width-alt: 2852" width=78><COL style="WIDTH: 57pt; mso-width-source: userset; mso-width-alt: 2779" width=76><COL style="WIDTH: 40pt; mso-width-source: userset; mso-width-alt: 1938" width=53><COL style="WIDTH: 75pt; mso-width-source: userset; mso-width-alt: 3657" width=100><COL style="WIDTH: 100pt; mso-width-source: userset; mso-width-alt: 4864" width=133><COL style="WIDTH: 48pt" span=2 width=64><TBODY><TR style="HEIGHT: 12.75pt; mso-height-source: userset" height=17><TD style="BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent; WIDTH: 581pt; HEIGHT: 153pt; BORDER-TOP: #f0f0f0; BORDER-RIGHT: #f0f0f0" id=td_post_2481960 class=xl69 height=204 rowSpan=12 width=773 colSpan=10>IF(OR(AND($K8=0,($L8>=13)*($L8<=19),($N8>=25.0)*($N8<=30.9),AND($K8=1,($L8>=13)*($L8<=19),($N8>=35.0)*($N8<38.3),AND($K8=0,($L8>=20)*($L8<=29),($N8>=23.6)*($N8<=28.9),AND($K8=1,($L8>=20)*($L8<=29),($N8>=33)*($N8<=36.4),AND($K8=0,($L8>=30)*($L8<=39),($N8>=22.8)*($N8<=26.9),AND($K8=1,($L8>=30)*($L8<=39),($N8>=31.5)*($N8<=35.4),AND($K8=0,($L8>=40)*($L8<=49),($N8>=21.0)*($N8<=24.4),AND($K8=1,($L8>=13)*($L8<=49),($N8>=30.2)*($N8<=33.5),AND($K8=0,($L8>=50)*($L8<=59),($N8>=20.2)*($N8<=22.7),AND($K8=1,($L8>=13)*($L8<=59),($N8>=26.1)*($N8<=30.9),AND($K8=0,($L8>=60),($N8>=17.5)*($N8<=20.1),AND($K8=1,($L8>=60),($N8>=20.5)*($N8<=26.0)),"1","0")

</TD></TR>












Below is the formula I need to use but it tells me there are more levels of nesting than allowed.
What do I do to make it work?:rolleyes:
<TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR><TR style="HEIGHT: 12.75pt" height=17></TR></TBODY></TABLE>
 
Not sure exactly what sort of values might be allowed in columns AN and AW, but setting up a lookup table and formula like this might give you what you want.

Formula in AY5 is copied down.

Excel Workbook
ANAOAPAQARASATAUAVAWAXAYAZBABB
100
23.92.6
34.32.8
44.42.9
52.23214.53.3
618.547.83153.6
718.939.935.53.8
820.4416.5264.4
919.339.9416.54.6
104.124.4417.55.2
1122.873.478.55.8
1225.1428.189.56.2
1316.4140.56110.56.6
1412.8928.27111.57.5
152.9137.48112.58.5
1618.522.2514.59.5
1726.512.5816.510.5
1818.671.9820.513.5
1919.149.49125.517.5
2011.1329.21133.921.5
2112.8445.221
Replace nested IFs
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Using Peter's layout

PHP:
=IF(AN5<VLOOKUP(AW5,$BA$1:$BB$20,2),1,"")
 
Upvote 0
Using Peter's layout

PHP:
=IF(AN5<VLOOKUP(AW5,$BA$1:$BB$20,2),1,"")
Jason

I see 1 possible problem and one definite problem with your solution.

1. Possible problem (easily fixed with an extra IF) is that the OP's original formula starts with
=if(AW5="","",
which makes me think that AW5 is possibly populated with a formula that could return "". In this case your formula errors.

2. Definite problem (assuming I have understood correctly) is that if AW5 is exactly equal to one of the values in column BA and AN5 is just below the corresponding column BB value then your formula returns a false "1". For example, the combination of AW5 = 20.5 and AN5 = 12 does not meet any of the listed criteria yet your formula returns a "1".

I initially didn't have the 0 values in the lookup table, and still don't know if that is suitable or whether negative values might turn up in the data. After adding the zeros to the table I forgot to remove a couple of the tests in my AND() function.

In any case perhaps one of these versions of your formula would be better than mine.

=IF(AN5< VLOOKUP(AW5-1/1000000,$BA$1:$BB$20,2),1,"")

=IF(AW5="","",IF(AN5< VLOOKUP(AW5-1/1000000,$BA$1:$BB$20,2),1,""))

Or perhaps you can see another better way again?
 
Upvote 0
Peter, thank you most kindly, I am most grateful. Also, thank you for your suggestion Jason, most appreciated.

@Peter,

Just to clarify your assumptions:

1. You are correct, AW5 gets its value from a vlookup formula in the cell. I.E. Cell AW5 contains the formular
=IF(BD5="","",VLOOKUP(BD5,Data!$C$5:$F$500,3,FALSE))

The if(AW5="","",
comes about if BD5 is "", then AW5 will be "".

2. For AW5, no negative values or zero would be returned.
For AN5, the values are got from data scrapped from a website. It will either return a value or blank, but no negative value or zero would be returned.

Many thanks
Dan
 
Upvote 0
2. For AW5, no negative values or zero would be returned.
For AN5, the values are got from data scrapped from a website. It will either return a value or blank, but no negative value or zero would be returned.

CORRECTION to the statement above. Should read:

2. For AW5, no negative values or zero would be returned.
For AN5, the values are got from another cell AH5, which gets its value from data scrapped from a website. It will either return a value or blank, but no negative value or zero would be returned.

Cheers
Dan
 
Upvote 0
For AN5, the values are got from another cell AH5, which gets its value from data scrapped from a website. It will either return a value or blank, but no negative value or zero would be returned.
I guess that means the formula we are working on should also check for blanks in AN5. Perhaps

=IF(COUNT(AN5,AW5)=2,IF(AN5< VLOOKUP(AW5-1/1000000,$BA$1:$BB$20,2),1,""),"")
 
Upvote 0
So I'm working on aging receivables and I'm trying to place invoices in buckets based on the terms we've established with the client, the invoice sent date and the current date. I have to drop them in buckets based on a week, 2 weeks,...45 days, and 60 days. My equation looks like this so far but I can't add any more arguments because the error this post is about.

=IF(AND($F4=15,$H4<=30),$K4,IF(AND($F4=30,$H4<=30),$K4,IF(AND($F4="AMEG",$H4<=30),$K4,IF(AND($F4="CEI",$H4<=30),$K4,IF(AND($F4="FRC",$H4<=30),$K4,IF(AND($F4="GLEN",$H4<=30),$K4,IF(AND($F4="MLLC",$H4<=30),$K4,IF(AND($F4="MLLC",$H4<=30),$K4,))))))))

I need to add more terms but well I'm sure you get it. Please help me out if you can.
 
Upvote 0
=IF(AND($F4=15,$H4<=30),$K4,IF(AND($F4=30,$H4<=30),$K4,IF(AND($F4="AMEG",$H4<=30),$K4,IF(AND($F4="CEI",$H4<=30),$K4,IF(AND($F4="FRC",$H4<=30),$K4,IF(AND($F4="GLEN",$H4<=30),$K4,IF(AND($F4="MLLC",$H4<=30),$K4,IF(AND($F4="MLLC",$H4<=30),$K4,))))))))

I need to add more terms but well I'm sure you get it. Please help me out if you can.
Welcome to the MrExcel board!

Without knowing what 'more terms' you want to add, it is hard to know what the best approach is.

However, I can make a couple of comments/suggestions about your formula so far.

The two red bits seem identical so you shouldn't need both of those.

Your formula so far has a whole lot of conditions that ..
a) have $H4<=30 as one of them, and
b) all return the value in $K4
.. so the formula so far could be replaced with this ..

=IF(AND(OR($F4={15,30,"AMEG","CEI","FRC","GLEN","MLLC"}),$H4<=30),$K4,"??")

If you could describe more fully what you have, where and what the formula is trying to achieve, it may bge that a better method can be suggested.

Perhaps you could show us a small screen shot or two to help explain. See my signature block for suggestions.
 
Upvote 0
I need to age receivables based on each terms grace period from the date their invoice was sent.

Example: I would need to make sure the balance in row 3 goes into the 1-8 column because they have a 30 day grace period but it's been 38 days since we mailed their invoice.

I also don't know how to deal with row 24 because they pay the following month from the bill shipping date on the 30th of that following month.

Let me know if I was clear enough in my explanation.

Aging.png
 
Upvote 0

Forum statistics

Threads
1,216,025
Messages
6,128,348
Members
449,443
Latest member
Chrissy_M

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