+ Reply to Thread
Results 1 to 4 of 4

Return a year for all data over a threshold in a row without macros

  1. #1
    Registered User
    Join Date
    02-19-2013
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question Return a year for all data over a threshold in a row without macros

    Hi all,

    First of all, let me say thank you for the countless times I have been able to solve a problem by reviewing posts and responses on the forum.
    This time, though, I was not able to solve it without asking the question myself, so here it comes.

    I have a financial model that returns ratios for various years. I would like to highlight in the summary part of the model those years where the ratio is over a set threshold.

    For example:
    A B C D ...
    1 2013 2014 2015 2016 ...
    2 31% 29% 41% 28% ...
    3 Max: 30%
    4 2 years over Max: 2013, 2015

    In the above example, the threshold (Max) is 30% (cell B3), so the value in A4 would be "2 years over Max: 2013, 2015"

    I have been able to do it manually by putting together a COUNTIF function along with various IF statements as follows:
    =COUNTIF(A2:D2,">="&B3)&" years over Max: "&IF(A$2>$B$3,A$1&", ,"")&IF(B$2>$B$3,B$1&", ","")&IF(C$2>$B$3,C$1&", ","")&IF(D$2>$B$3,D$1&", ","")...

    I even managed to get rid of the final "," by adding a second "," at the end and replacing the expression ", ," using the SUBSTITUTE function (yes, I am a bit **** when it comes to details).

    My problem is that I currently have 16 years of projections and, although the above formula works, it requires manual changes everytime I add / remove years.

    I know that I can do it easily in VBA but the Excel file is to be shared with others via email and I know that their systems are setup to desactivate macros by default (and I don't want to rely on the user having to manually activate macros).

    SO, the big question is: can you think of an easier way to do this?

    Thanks,

    Pierre
    Attached Files Attached Files

  2. #2
    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: Return a year for all data over a threshold in a row without macros

    Concatination isn't a strong point with native Excel formulae, and is as you know, normally solved with VBa.

    See if this rather convoluted workabout helps, it uses names, and helper rows (hidden with the grouping +/- button)
    Attached Files Attached Files
    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.

  3. #3
    Registered User
    Join Date
    02-19-2013
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Return a year for all data over a threshold in a row without macros

    Thanks Marcol, I like the approach.
    I was thinking about having hidden rows where I would do the check and concatenate the results column by column. I never think to use the INDEX function for this kind of things.
    Hidden rows is not the ideal but its workable.

  4. #4
    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: Return a year for all data over a threshold in a row without macros

    Try putting the hidden rows in a seperate hidden sheet for calculations only, then refer to that.

+ 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