+ Reply to Thread
Results 1 to 7 of 7

Too Many Nested Levels - What's the PROPER way to write this formula?

  1. #1
    Registered User
    Join Date
    10-02-2015
    Location
    Seattle, WA
    MS-Off Ver
    2013
    Posts
    3

    Too Many Nested Levels - What's the PROPER way to write this formula?

    Not knowing many of the functions, I attempted to create a YTD Growth formula. Thing is, it needs to look at all 12 months and work regardless of whether the year is completely filled out yet. Here's what I did:

    Please Login or Register  to view this content.
    It basically starts to see if there's a number in December, and then keeps checking back to February. Once it finds a value, it subtracts it from the initial value (January) and calculates the YTD Growth.

    Obviously, Excel doesn't like all the nestiness.

    If anyone has any ideas, I'd appreciate it!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,669

    Re: Too Many Nested Levels - What's the PROPER way to write this formula?

    Suggest you post a sample workbook with some typical data and indicate tour expected results given whatever conditions may apply ... full year, part year, gaps, whatever.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-10-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    41

    Re: Too Many Nested Levels - What's the PROPER way to write this formula?

    This should do the trick.
    Please Login or Register  to view this content.
    Vidya Palani

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Too Many Nested Levels - What's the PROPER way to write this formula?

    Nested IFs are fine until they get too many, then you should be considering creating a table and using lookups.

    Try
    =(INDEX(C4:M4,1,MATCH(TRUE,INDEX(ISBLANK(C4:M4),0,0),0)-1)-B4)/B4

    This part

    MATCH(TRUE,INDEX(ISBLANK(C4:M4),0,0),0)

    finds the first blank in the row

    This assumes that C4:M4 will either be a number or blank.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  5. #5
    Registered User
    Join Date
    10-02-2015
    Location
    Seattle, WA
    MS-Off Ver
    2013
    Posts
    3

    Re: Too Many Nested Levels - What's the PROPER way to write this formula?

    Quote Originally Posted by Vidya Palani View Post
    This should do the trick.
    Please Login or Register  to view this content.
    Wow. That. Worked. PERFECTLY.

    I won't waste your time by asking you to explain, but rest assured that I'll be researching to figure out exactly what you did there.

    THANK YOU!!!

  6. #6
    Registered User
    Join Date
    10-02-2015
    Location
    Seattle, WA
    MS-Off Ver
    2013
    Posts
    3

    Re: Too Many Nested Levels - What's the PROPER way to write this formula?

    Quote Originally Posted by Vidya Palani View Post
    This should do the trick.
    Please Login or Register  to view this content.
    Okay, I do have one question. I have several rows for which this worked great. However, I have a bottom row that sums up each column using the formula:

    Please Login or Register  to view this content.
    So, obviously, columns L and M (November and December) appear "empty" on this row because I haven't input any data for those months yet, but still have a hidden formula. I'm guessing that the formula provided is counting all the way out to M, settling on M as having a value, and then trying to calculate the YTD growth with an empty cell, leading to a #VALUE! error.

  7. #7
    Registered User
    Join Date
    10-10-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    41

    Re: Too Many Nested Levels - What's the PROPER way to write this formula?

    Try using Count instead of Counta.

    Please Login or Register  to view this content.

+ 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. Tolerance Formula based on Different Levels - Nested If?
    By dminar11 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-18-2013, 01:38 PM
  2. Nested IF levels have changed...
    By Moo the Dog in forum Tips and Tutorials
    Replies: 4
    Last Post: 01-12-2013, 05:26 PM
  3. [SOLVED] How to write nested IF formula
    By spics89 in forum Excel General
    Replies: 5
    Last Post: 07-22-2012, 10:54 AM
  4. how to write a nested if formula with special conditions
    By novice2430 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-19-2009, 08:55 PM
  5. How to write this 4 condition nested formula?
    By bortz in forum Excel General
    Replies: 3
    Last Post: 12-09-2005, 09:55 AM
  6. IF function with 14 nested levels
    By Dan Fingerman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 PM
  7. [SOLVED] IF function with 14 nested levels
    By Dan Fingerman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  8. [SOLVED] IF function with 14 nested levels
    By Dan Fingerman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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