+ Reply to Thread
Results 1 to 10 of 10

Extracting First Instance from Index (Match) function

  1. #1
    Registered User
    Join Date
    01-06-2022
    Location
    Canada
    MS-Off Ver
    2111
    Posts
    10

    Extracting First Instance from Index (Match) function

    Hello,

    I am trying to write an equation that will allow me to pull out the value that corresponds to the closest instance that my criteria becomes true. To provide an example: I have two columns of values. Column A represents acceleration; A = {0.2, 0.5, 0.8, 0.2, 0.5, 1.0, 0.9, 0.6, 1.3, 1.7, 2.8, 1.0, 0.5} and Column B represents location; B = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}. I want to extract the value that represents 60% of maximum acceleration.

    I have been trying the following equation : Index(A1:A13,Match(Max((A1:A13))*0.6,A1:A13,1)).

    The issue I am facing is that within my true larger data set, the 60% of max acceleration occurs repeats several times (as does this example with 1.0) and the above equation will extract the final occurrence of 60% acceleration when in reality I want the first occurrence. (Equation pulls acceleration = 1.0 at position 12 opposed to acceleration = 1.0 at position 6).

    Any help on this would be greatly appreciated!

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: Extracting First Instance from Index (Match) function

    Next time, please post a sample file rather than strings in the post that are a pain to get into an Excel sheet!!!


    =LOOKUP(0,0/FREQUENCY(0,ABS(A3:A15-0.6*MAX(A3:A15))),B3:B15)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    01-06-2022
    Location
    Canada
    MS-Off Ver
    2111
    Posts
    10

    Re: Extracting First Instance from Index (Match) function

    Hi Glenn,

    Thanks for the help, unfortunately that example still does not seem to work. I have attached the excel sheet pertaining my data set. Within it I have highlighted the error.

    For additional context - I am trying to determine the x location at which 40 and 60% max y occur. Within this data set it is pulling the closest value to 60% max y when I am looking for the first instance of the closest value. (I have highlighted the cell I am trying to pull).

    Thanks again for the help,

    Nick
    Attached Files Attached Files
    Last edited by NMacs; 02-10-2022 at 02:53 PM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: Extracting First Instance from Index (Match) function

    No. You're wrong.

    Max 1.472. 60% of same is 0.8832

    I filtered the data to show a narrow range round thast value. Row 846 is closest. The formula in F2 gives the correct answer.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-06-2022
    Location
    Canada
    MS-Off Ver
    2111
    Posts
    10

    Re: Extracting First Instance from Index (Match) function

    It is the correct answer the way you approached it but it is not the answer I need. I need the value that is 60% of max Y prior to Max Y, yet still pulling from the entire array as I will be using this general setup for 60 data sets.

    If you don't know a solution to this problem hopefully another individual can provide some insight.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: Extracting First Instance from Index (Match) function

    Mea culpa. I misunderstood...


    =LOOKUP(0,0/FREQUENCY(0,ABS(A4:INDEX(A:A,MATCH(I1,A:A,0))-0.6*MAX(A4:A1487))),B4:INDEX(B:B,MATCH(I1,A:A,0)))
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-06-2022
    Location
    Canada
    MS-Off Ver
    2111
    Posts
    10

    Re: Extracting First Instance from Index (Match) function

    Thanks a lot for your help Glenn, much appreciated.

    For future reference / simplicity, is there a way in excel that the length of an array in an equation can be described by another cell? I.e. if I have 1 cell that specifies the cell at which max y occurs (152 rows down from beginning), can the length of the array within the equation vary based on the cell containing "152"?

    Nick

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,004

    Re: Extracting First Instance from Index (Match) function

    Yes... but I hate using INDIRECT. It's volatile and recalculates if/when anything changes.

    =LOOKUP(0,0/FREQUENCY(0,ABS(INDIRECT("A4:A"&F5)-0.6*MAX(A4:A1487))),INDIRECT("B4:B"&F5))
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Extracting First Instance from Index (Match) function

    Another option without indirect
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    01-06-2022
    Location
    Canada
    MS-Off Ver
    2111
    Posts
    10

    Re: Extracting First Instance from Index (Match) function

    Good to know, I deciphered the same idea from the original equation you provided.

    Thanks again,

    nick

+ 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. Countif/Index/Match - need to count all instance
    By kinirobin in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-17-2019, 08:05 AM
  2. find nth instance using index match
    By melvinkoshy in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-03-2019, 12:50 PM
  3. Speed up Excel Index Match - First Instance
    By lesaiot29 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-28-2018, 11:55 AM
  4. [SOLVED] Index/ Match Last Instance
    By Burt_100 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-29-2015, 12:05 AM
  5. Index/Match ignoring Blanks/Zeros for each instance
    By corhrtz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-18-2015, 11:04 AM
  6. Replies: 4
    Last Post: 01-10-2014, 05:09 PM
  7. [SOLVED] Index / Match to find next instance of a value
    By boylers75 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-10-2012, 10:06 AM

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