+ Reply to Thread
Results 1 to 5 of 5

Nested IF levels have changed...

  1. #1
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Nested IF levels have changed...

    Excel is limited to 7 nested IF statements
    I have seen this statement (or something very similar) posted a few times recently on the Forum, and wanted to update anyone who isn't aware...

    The 7 Nested IF limit has been raised to 64 nested levels since Excel 2007.
    http://office.microsoft.com/en-us/ex...aspx#BMformula

    This formula works perfectly fine in Excel 2007 & 2010:
    =IF(A1=1,1,IF(A1=2,2,IF(A1=3,3,IF(A1=4,4,IF(A1=5,5,IF(A1=6,6,IF(A1=7,7,IF(A1=8,8,IF(A1=9,9,IF(A1=10,10,"nope"))))))))))

    Not that you would WANT to use it.... but it is valid. Of course, if a user is still using 10 year old software (2003), then the max is still 7 levels.

    - Moo

  2. #2
    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,938

    Re: Nested IF levels have changed...

    Good post Moo, thanks for the update
    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

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Nested IF levels have changed...

    Quote Originally Posted by Moo the Dog View Post
    =IF(A1=1,1,IF(A1=2,2,IF(A1=3,3,IF(A1=4,4,IF(A1=5,5,IF(A1=6,6,IF(A1=7,7,IF(A1=8,8,IF(A1=9,9,IF(A1=10,10,"nope"))))))))))

    Not that you would WANT to use it
    Indeed not, this version avoids nested IFs:

    =IF(NOT(ISERROR(MATCH(A1,INDEX(ROW(INDIRECT("1:10")),0),0))),VALUE(MID(CELL("Address",OFFSET(A1,A1-1,0)),FIND("~",SUBSTITUTE(CELL("Address",OFFSET(A1,A1-1,0)),"$","~",2))+1,255)),"Nope")


  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Nested IF levels have changed...

    LOL... Andrew-R... you win hands down for complexity.

    - Moo

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Nested IF levels have changed...

    Excel is limited to 7 nested IF statements
    Yes, the limit increased to 64 in Excel 2007 - but note that it's always been a limitation on nested functions. You can't nest more than 7 functions, of any type, in Excel 2003, so this formula works in Excel 2007 but not in Excel 2003

    =RIGHT(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("nested","n","f"),"e","u",1),"s","n"),"t","c"),"e","t"),"d","io"),"io","ion"),8),8)
    Audere est facere

+ 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