+ Reply to Thread
Results 1 to 10 of 10

Index Match to return last value

Hybrid View

  1. #1
    Registered User
    Join Date
    10-13-2014
    Location
    South Africa
    MS-Off Ver
    2007
    Posts
    8

    Index Match to return last value

    Hi Guys Im new here and was hoping someone could help me

    I would like to edit the following formular to return the last found value in colum A:A instead of the first value
    apparently this is an array formular (not quite sure what that means), but basically it is only returning my value if all 3 criteria is met

    I would still like it to retun my value only if all 3 criteria is matched, but the difference being the last found value.

    My lookup ID's are numerical like this 11001, 11002, 11003 ect, my data is not sorted which is why I chose index match

    {=IFERROR(IF($A4<>"",VALUE(INDEX(YTD!$A:$X,MATCH(1,(YTD!$A:$A=$A4)*(YTD!$F:$F=$B4)*(YTD!$H:$H=$C4),0),24)),""),"")}


    Thanks all in adavance
    Last edited by Johnathan Fouche; 10-13-2014 at 11:09 PM.

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Index Match to return last value

    Hi,

    I would like to propose a LOOKUP(2 ...

    the new formula segment could be (instead of INDEX...

    LOOKUP(2,1/((YTD!$A1:$A1000=$A4)*(YTD!$F1:$F1000=$B4)*(YTD!$H1:$H1000=$C4)),YTD!X1:X1000)

    Just an attempt
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    10-13-2014
    Location
    South Africa
    MS-Off Ver
    2007
    Posts
    8

    Re: Index Match to return last value

    Hi thanks for your quick response. I read some where that index match was better interms of possessing and my sheet is already struggling. Also that if I wanted to have 3 colums criteria used that I would need to use index match. Is this true?

  4. #4
    Registered User
    Join Date
    10-13-2014
    Location
    South Africa
    MS-Off Ver
    2007
    Posts
    8

    Re: Index Match to return last value

    Hi thanks to all for the reaponses. Will try this array when I get back to work.

  5. #5
    Registered User
    Join Date
    10-13-2014
    Location
    South Africa
    MS-Off Ver
    2007
    Posts
    8

    Re: Index Match to return last value

    Quote Originally Posted by canapone View Post
    Hi,

    I would like to propose a LOOKUP(2 ...

    the new formula segment could be (instead of INDEX...

    LOOKUP(2,1/((YTD!$A1:$A1000=$A4)*(YTD!$F1:$F1000=$B4)*(YTD!$H1:$H1000=$C4)),YTD!X1:X1000)

    Just an attempt
    Hi Thanks alot this one did the trick. for interest sake, could you break it down so that I can understand it better, mostly the first part.

  6. #6
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Index Match to return last value

    Hi, Try this array

    Formula: copy to clipboard
    =INDEX(YTD!X1:X1000,LARGE(IF(YTD!A1:A1000=A4,IF(YTD!F1:F1000=B4,IF(YTD!H1:H1000=C4,ROW(YTD!X1:X1000)))),1),)
    Click just below left if it helps, Boo?ath?

  7. #7
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Index Match to return last value

    Hi welcome to this forum...
    Try this.. Array entered formula...
    Formula: copy to clipboard
    =INDEX(YTD!X1:X1000,MAX(IF((YTD!A1:A1000=A4)*(YTD!F1:F1000=B4)*(YTD!H1:H1000=C4),ROW(YTD!X1:X1000))),)
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  8. #8
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Index Match to return last value

    Hi,

    your formula looks great to manage 3 columns criteria. LOOKUP(2... is a different tecnique to approach the problem.

    INDEX( LARGE or INDEX(MAX confirmed with control+shift enter are very good approaches too:

    Maybe a small sample file could help to fine-tune the formulas.

    Regards

  9. #9
    Registered User
    Join Date
    10-13-2014
    Location
    South Africa
    MS-Off Ver
    2007
    Posts
    8

    Re: Index Match to return last value

    Will upload when I get back to work. Help is appreciated

  10. #10
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Index Match to return last value

    Hi, thanks for your kind feedback


    This segment:

    (YTD!$A1:$A1000=$A4)*(YTD!$F1:$F1000=$B4)*(YTD!$H1:$H1000=$C4))

    will return an array of either TRUE or FALSE: TRUE only when thee conditions are met. The division operations convert those logical values to numeric values and errors.

    1/TRUE = 1

    1/FALSE = #DIV/0!

    LOOKUP reads an array of 1s and #DIV/0! errors. 2 is the lookup value. LOOKUP is searching a 2. Now, if the lookup value is greater than any number in the array of 1s and #DIV/0! errors, then the formula will look for (match) the last number in the array that is less than the lookup value (2).

    The only and the largest number produced by formula in the array is 1, so every number in the array (1,error,1,1,error) is less than the lookup value of 2 and returns the corresponding result as expected. LOOKUP ignores and skips error.

    Same results if you change 2 with every number greater than 1.

    Cheers
    Last edited by canapone; 10-18-2014 at 07:58 AM.

+ 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. Replies: 5
    Last Post: 10-16-2016, 02:33 AM
  2. [SOLVED] Vlookup/index/match to return all values that match
    By Asil01 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-09-2014, 12:49 PM
  3. [SOLVED] Combining 3 Formulas: Return all Names that Match Criteria Using Index/Match
    By bchilme in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-29-2014, 09:28 AM
  4. Using Index/Match to return multiple values for one match
    By superboy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-10-2014, 06:21 PM
  5. Replies: 3
    Last Post: 05-08-2013, 02:10 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