+ Reply to Thread
Results 1 to 5 of 5

levels of nesting help

  1. #1
    Registered User
    Join Date
    05-15-2012
    Location
    Hassocks, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    levels of nesting help

    Hello Everyone,

    Would appreciate some help on this...

    i have created a spreadsheet to determine how many miles i drive on a monthly basis and i wanted to create a formula to do this for me.
    For example, when i first started i used the following information:

    h-w (home to work) 4 Miles
    h-gf (home to girlfriends) 8 Miles
    h-f (home to football) 10 Miles
    h-c (home to cinema) 17 Miles

    ...and i used the formula =IF(B11="h-w","4",IF(B11="h-gf","8",IF(B11="h-f","10",IF(B11="h-c","17"))))

    meaning that if write "h-w" in B11 then C11 shows "4", if i put "h-gf" it would show "8", and so on...

    This worked fine until i added more circumstances. Now i have 15, it comes up with an error message " The specified formula cannot be entered because it uses more levels of nesting than are allowed in the current file format", i can only put in 7 before this error message comes up...

    How can i do i increase the amount of levels of nesting?
    Or is there a different formula that u can use?

    Please help,

    Thanks!
    Jamie

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: levels of nesting help

    Use choose. Easier to expand.

    =CHOOSE(MATCH(B11,{"h-w","h-gf","h-f","h-c"},0),4,8,10,17)

  3. #3
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: levels of nesting help

    If you expect to have a growing list of destinations and want to vary start and ending points (work to girlfriend versus home to girlfriend), then you should consider creating a lookup table.

    If you're just tracking from home to whereever, then just use the input cell to show the destination only (i.e w, c, gf, etc) since the starting location is always the same.

    =LOOKUP(B11,{"c","f","gf","w"},{17,10,8,4})
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  4. #4
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    171

    Re: levels of nesting help

    Try creating a matrix with the locations (H, W, GF, F, C along the row and column and fill in the numbers). Then you can reference this matrix everytime you want to calculate distance. Also, if you name the range, you will have an easier time adding locations than if you just use the range. If this doesn't make sense, post a file and I'll show you.

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: levels of nesting help

    As a matter of interest ...
    i can only put in 7 before this error message comes up...
    Your profile states you are using 2007, this version, and above, allows 64 nested IF()s, though why you would ever need that many I don't know.
    Better to use the above suggestions.

    In 2003 and earlier the limit is 7, so I guess you must be using an earlier version than 2007, if not then you are running in compatibility mode this will limit you to 2003 specifications.
    Last edited by Marcol; 05-15-2012 at 06:47 PM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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