+ Reply to Thread
Results 1 to 15 of 15

"too much nesting"

  1. #1
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    "too much nesting"

    I'm getting an error that says "the specified formula cannot be entered because it uses more levels of nesting than are allowed in the current file format".

    Is there any way around this? I need the entire formula I'm entering into the cell.

    Thanks
    Last edited by gss; 03-23-2009 at 02:09 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: "too much nesting"

    What exactly is your current formula and what do you want it to do?

    There are several ways around the nested if's.. but we need to know what you are looking at.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: "too much nesting"

    This is what I currently have which works:

    =(IF(ISERROR(B5-5>=0),"",IF(AND(D4>Cp_1,Cp_1>D4-5),Cp_1,IF(AND(D4>Cp_2,Cp_2>D4-5),Cp_2,IF(AND(D4>Cp_3,Cp_3>D4-5),Cp_3,IF(AND(D4>Cp_4,Cp_4>D4-5),Cp_4,IF(((B5-5)<>(CEILING(B5,5)-5)),FLOOR(B5,5),IF(B5-5>=0,B5-5,""))))))))

    And this is what I need (I've added a bunch of if statements to the one above):

    =(IF(ISERROR(B5-5>=0),"",IF(AND(D4>Cp_1,Cp_1>D4-5),Cp_1,IF(AND(D4>Cp_2,Cp_2>D4-5),Cp_2,IF(AND(D4>Cp_3,Cp_3>D4-5),Cp_3,IF(AND(D4>Cp_4,Cp_4>D4-5),Cp_4,IF(AND(D4>Hta_1,Hta_1>D4-5),Hta_1, IF(AND(D4>Hta_2,Hta_2>D4-5),Hta_2, IF(AND(D4>Hta_3,Hta_3>D4-5),Hta_3, IF(AND(D4>Hta_4,Hta_4>D4-5),Hta_4, IF(AND(D4>Hta_5,Hta_5>D4-5),Hta_5, IF(AND(D4>Htb_1,Htb_1>D4-5),Htb_1, IF(AND(D4>Htb_2,Htb_2>D4-5),Htb_2, IF(AND(D4>Htb_3,Htb_3>D4-5),Htb_3, IF(AND(D4>Htb_4,Htb_4>D4-5),Htb_4, IF(AND(D4>Htb_5,Htb_5>D4-5),Htb_5,IF(((B5-5)<>(CEILING(B5,5)-5)),FLOOR(B5,5),IF(B5-5>=0,B5-5,""))))))))

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: "too much nesting"

    Assuming you are expecting numeric results, try:

    Please Login or Register  to view this content.
    Basically it separates the conditions into separate IF() statements and adds the results of each together... all but 1 should result in 0... so the final result should be the result you want.

  5. #5
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: "too much nesting"

    It didn't work. It's giving me a #NAME? error.

  6. #6
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: "too much nesting"

    I may be doing something else wrong because I deleted all the additional stuff I added to the original code (from yours) and it works.

    i.e.

    =IF(ISERROR(B5-5>=0),0,IF(AND(D4>Cp_1,Cp_1>D4-5),Cp_1,0)+IF(AND(D4>Cp_2,Cp_2>D4-5),Cp_2,0)+IF(AND(D4>Cp_3,Cp_3>D4-5),Cp_3,0)+IF(AND(D4>Cp_4,Cp_4>D4-5),Cp_4,0)+IF(((B5-5)<>(CEILING(B5,5)-5)),FLOOR(B5,5),IF(B5-5>=0,B5-5,0)))

    I'll take another look to make sure all the variables in the code are actually called out.

  7. #7
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: "too much nesting"

    I fixed my mistake and now the code works, but for some reason, where it should be giving me an output of 113, it's giving me an ouput of 223.

    I'll figure out where I'm going wrong.

    Thanks a lot!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: "too much nesting"

    Is it possible that more than one of the separate IF statements will give a TRUE result? If so, then those are being added together... and also, if so, should there be more than one TRUE result?

  9. #9
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: "too much nesting"

    Most of the time (as is the case where the output should be 113 but it's giving me 223) only one of the IF statements will give a TRUE result. At most two cases will give a TRUE result. In those cases, the larger number should be used.

    I believe that is the problem, the two numbers are being added. Right now (with the original code) the output is 110. I should be getting a 113. Adding those together it's giving me 223.

    Can you help me fix this. I have no idea where to start.

    Thanks.

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: "too much nesting"

    Can you attach the spreadsheet?

    or maybe
    Please Login or Register  to view this content.
    Last edited by NBVC; 03-23-2009 at 01:31 PM.

  11. #11
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: "too much nesting"

    That did the trick!

    Thanks!

    I have one more question:

    How do I make it so that every other row that has data in it is a different color?

    i.e.

    Say I have values in cells A1 to A34. I want rows 2,4,6,8, etc. to change to a light green color.

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: "too much nesting"

    Great!

    Please start a new thread for unrelated questions... This will help to keep the forum more organized.

    Also please mark this thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  13. #13
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: "too much nesting"

    I'm sorry, but I have one more problem with this code.

    The output eventually hits zero. So, for example, if D34 is zero, I want the succeeding cells to be blank (in this case D35, D36, etc). But with this code, D35 is giving me an output of #VALUE!

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: "too much nesting"

    You can use an initial IF() statement to take care of that:

    e.g.

    Assuming formula is in Row 4:

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    01-02-2009
    Location
    pittsburgh, pa
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: "too much nesting"

    Works! Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1