+ Reply to Thread
Results 1 to 11 of 11

INDEX/MATCH combo with using nth result

  1. #1
    Registered User
    Join Date
    02-27-2018
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    INDEX/MATCH combo with using nth result

    Hi there,

    I am trying to set up a tracking sheet so I can track test results for an asset base. The asset base is in excess of 700K so trying to do horizontal matching and I am having some issues I cannot wrap my head around.

    Trying to track the below:
    - latest successful test year (seems to work)
    - previous test year (can't get a horizontal match function to work on 2nd highest year)
    - time between tests (latest - previous[if I could get it too work...])
    - Removal Year (works only when there is a single pass result, doesn't work if multiple PASS results are in the same row....)

    I have attached the redacted dummy spreadsheet above. Any help would be very much appreciated.
    Cheers,
    Hearny
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: INDEX/MATCH combo with using nth result

    Previous Test Year:
    Please Login or Register  to view this content.
    Latest Test Year:
    Please Login or Register  to view this content.
    Removal Year:
    Please Login or Register  to view this content.
    Named Range: TestYear:=Sheet1!$F$1:$AN$1


    All array formulas, therefore:
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Attached Files Attached Files
    Ben Van Johnson

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: INDEX/MATCH combo with using nth result

    Another way.

    For Latest Test Year
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then grab the fill handle and drag to the left to return Previous Test Year.

    Years between tests.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Removal year
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  4. #4
    Registered User
    Join Date
    02-27-2018
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: INDEX/MATCH combo with using nth result

    Hi Ben!
    TBH, I never knew I could define cells with a name. Makes troubleshooting so much quicker!

    Thank you for the reply! Few questions:
    - When there are no PASS or FAIL cells "Latest Test Year:" & "Removal Year:" default to 2018.
    Capture001.PNG
    - The formulae above only use COLUMN to AI where as the TestYear data set goes to AN. Adjusting the formula to suit results in #N/A. Is this coincidental as the 5 missing columns = 5 starting columns before the years (A:E vs AJ:AN)?
    Capture002.PNG

    Cheers mate!
    Hearny

  5. #5
    Registered User
    Join Date
    02-27-2018
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: INDEX/MATCH combo with using nth result

    Hi Dave!

    Thank you for the response!
    I can't seem to fault the formula you have supplied...
    I can only fault myself at the moment as I can't wrap my head around 'how' it is working...
    Gonna reverse engineer it and see if I can learn something new!

    EDIT:
    I removed a few $ signs to allow for drag down on asset base.
    Is this breakdown of the formula correct?
    If so, how would the 2 COLUMNS in the AGGREGATE help with Prev Test Year?
    This AGGREGATE function can be used as REFERENCE or ARRAY - this situation array based?
    Capture003.PNG
    Last edited by Hearny; 02-28-2018 at 07:58 PM.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: INDEX/MATCH combo with using nth result

    ... The formulas above only use COLUMN to AI where as the TestYear data set goes to AN. Adjusting the formula to suit results in #N/A. Is this coincidental as the 5 missing columns = 5 starting columns before the years (A:E vs AJ:AN)?

    TextYear is an array spanning columns 6 - 40. However, the elements of that array are accessed by addresses 1 - 35.

    The IF condition test returns an array of TRUE or FALSE values depending on the result of the test in each column: {TRUE,FALSE,FALSE,TRUE,FALSE,...,FALSE}.

    Note that the elements of the array are counted starting from 1 - 35. In order to get the correct element from the array, I used COLUMNS(A1:AI1) which returns the array {1,2,...,35}. For the example sheet, the array passed to MAX() from the IF() is {1,FALSE,FALSE,4,FALSE,...,FALSE}. MAX() returns 4 to INDEX(), INDEX() returns the forth element of TestYear: 2021.

    If you use COLUMNS(F1:AN1), the array would be {6,7,8,...,40}; the IF() would then return {6,FALSE,FALSE,9,...,FALSE} to MAX() which would return 9 to INDEX(), i.e., 2026
    COLUMNS(F1:AN1)-5 is another alternative.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: INDEX/MATCH combo with using nth result

    ($F2:$AN2="FAIL")

    Yes. My bad setting that whole range absolute ... force of habit.

    (COLUMN($F2:$AN2)-MIN(COLUMN($F2:$AN2))+1)

    That's acceptable. I set those absolute as a self-imposed discipline when setting ROW/COLUMN indexes. It's too easy (for me) to overlook when it is an issue.

  8. #8
    Registered User
    Join Date
    02-27-2018
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: INDEX/MATCH combo with using nth result

    Thank you again for the replies ProtonLeah & FlameRetired!

    In relation to FlameRetired's forumale - one thing occurred to me.
    The "Latest Test Year" should also look for a FAIL cell, as it was tested this year, it just didn't pass.
    Removal Year will then equal FAIL cell + 1 year.
    I attempted to include an OR function (2 ways) in the denominator of the TRUE test but now all it returns is #NUM! or a static 2052...

    Thanks again
    Cheers,
    Hearny
    Attached Files Attached Files

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: INDEX/MATCH combo with using nth result

    Hi again.

    OR as applied in the latest will return a single TRUE/FALSE. This formula needs an array of TRUE/FALSE ie 1/0. If you are not aware of it "adding" conditions functions as a logical OR and will return that array. To see the effect of that try selecting just (($F2:$AN2="PASS")+($F2:$AN2="FAIL")) in the formula bar and hit the F9 function key. You should see {1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} in the divisor.

    With that understanding under 'Latest Test Year:' try this in C2.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Under 'Removal year:' (if I understand correctly) simply adding 1 to that formula should do the job.
    Last edited by FlameRetired; 03-04-2018 at 10:14 PM.

  10. #10
    Registered User
    Join Date
    02-27-2018
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: INDEX/MATCH combo with using nth result

    Hi FlameRetired and protonLeah,

    Thank you both again for all your help.
    Works flawlessly now and I won't have to manually sort and plan this database every year now.
    Marked thread as solved.

    Until next time - take care,
    Cheers,
    Hearny

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: INDEX/MATCH combo with using nth result

    You are welcome. Thank you for the feedback and marking your thread Solved.

+ 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] INDEX/MATCH generates incorrect result by referencng nearest cell if match not found
    By aglawrence in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-29-2017, 08:59 AM
  2. [SOLVED] Index Match Combo
    By SimonCampbell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-19-2017, 06:25 AM
  3. Index, Match, If / And, Combo Box used in Conjunction??
    By childs71 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2015, 08:35 AM
  4. [SOLVED] Index/Match result should again search for zero result
    By ursanil in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2014, 04:45 AM
  5. index match, ..... skip result if blank value ...... jump to next match
    By gehawk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-08-2013, 04:42 AM
  6. Three Way Lookup Using Index Match Combo
    By nathanhamilton82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-07-2012, 03:39 PM
  7. Lookup, Index, Match ... Not sure which combo will do it?
    By nikko4239 in forum Excel General
    Replies: 4
    Last Post: 06-08-2010, 06:32 PM

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