+ Reply to Thread
Results 1 to 7 of 7

Formula Limit?

  1. #1
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Question Formula Limit?

    I have been working on a sheet and everything seem to work well. However with that said check this out

    =IF(D50+D51=0,"",IF(D50+D51>=56,"8 Days",IF(D50+D51>=48,"7 Days",IF(D50+D51>=40,"6 Days",IF(D50+D51>=32,"5 Day",IF(D50+D51>=24,"4 Days",IF(D50+D51>=16,"3 Days",IF(D50+D51>=8,"2 Days",IF(D50+D51<=8,"1 Day")))))))))

    This formula worked until I added IF(D50+D51>=56,"8 Days", is there a limit for how long a formula can be??

    Thank You
    VinnySx

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Formula Limit?

    Nesting limits do exist. Hitting them usually indicates you should try a different approach.

    Try this instead:

    Please Login or Register  to view this content.
    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,007

    Re: Formula Limit?

    Hi,
    2003 version has 7 if function limit.
    2007-2010-2013 versions has no if function limit.
    Check following link...
    http://www.youtube.com/watch?v=5V_JYGfCIDE
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula Limit?

    works for me but you have a conflict at the end
    IF(D50+D51>=8,"2 Days",IF(D50+D51<=8 cant be both for 8
    try this
    =IF(SUM(D50:D51),LOOKUP(D50+D51,{0,8,16,24,32,40,48,56},{1,2,3,4,5,6,7,8})&IF(D50+D51<8," day"," days"),"")
    Last edited by martindwilson; 08-18-2014 at 06:44 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    08-10-2014
    Location
    Massachusetts
    MS-Off Ver
    2007
    Posts
    22

    Re: Formula Limit?

    Hi ConneXionLost

    That seemed to work and a lot less code too, THANK YOU. HerryMarkowitz I am using 2007 not sure why its not working?? However ConneXionLost approach seem to do the trick.

    Thank You
    VinnySx

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Formula Limit?

    While yes, there is a limit to the length of a formula, I dont think you are even close to that.

    Having said that, I would create a small table and use a vlookup for this, instead...
    A
    B
    26
    41
    6
    27
    0
    1
    28
    8
    2
    29
    16
    3
    30
    24
    4
    31
    32
    5
    32
    40
    6
    33
    48
    7
    34
    56
    8


    A26 contains the value to look up, in this case 41, but you would put that into your formula as D50+D5
    B26=VLOOKUP(A26,$A$27:$B$34,2,1)

    Using this, you can grow your table with minimum impact of your formula
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula Limit?

    Quote Originally Posted by HerryMarkowitz View Post
    Hi,
    2003 version has 7 if function limit.
    2007-2010-2013 versions has no if function limit.
    Excel 2003 and earlier has a limit of 7 nested levels for ALL functions, not just the IF function.

    http://office.microsoft.com/en-us/ex...005199291.aspx


    Excel 2007 and later the limit is 64 levels of nested functions.

    http://office.microsoft.com/en-us/ex...010073849.aspx
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Needing to set a limit in an IF formula
    By jnelson83 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-15-2013, 06:11 AM
  2. Replies: 4
    Last Post: 07-16-2013, 10:32 AM
  3. [SOLVED] find the lower and upper limit if data is in between on that limit
    By clangeles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-27-2012, 06:18 AM
  4. Replies: 2
    Last Post: 03-09-2011, 04:48 AM
  5. Replies: 1
    Last Post: 01-13-2011, 02:29 PM

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