+ Reply to Thread
Results 1 to 5 of 5

Match Function - Finding The Last Instance

  1. #1
    Registered User
    Join Date
    06-10-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Match Function - Finding The Last Instance

    Hello

    I am trying to use match to search a row for a date and return the position of the last value of that date. For example I am trying to search for 07/10/10 in the 2nd row but the first few instances of it don't have the correct data below it, so I need to find the last instance of it. Does that make sense?

    I am currently trying to make a loop so it will find the date and if the cell below it is 0, it finds the next cell etc but surely there is a more efficient way that I don't know of

    Thanks

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Match Function - Finding The Last Instance

    Is this a VBA or Formula question ?

    Are the values in Row 2 in Ascending order ?

    Yes: you can use match_type of TRUE in the MATCH
    (though you need to ensure the date returned matches the criteria - ie the MATCH will return last value <= criteria)

    No: you would use an alternate approach - LOOKUP approach specifically

    Let us know if this is a VBA or formula driven question.

  3. #3
    Registered User
    Join Date
    06-10-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Match Function - Finding The Last Instance

    This is in VBA. The values aren't in ascending order. How would I go about using LOOKUP? When I've tried using that it keeps returning the date, not the position of the cell

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Match Function - Finding The Last Instance

    In theory if we assumes dates are in Row 2 and you want the column of last instance:

    Please Login or Register  to view this content.
    you could also consider using a Find method ...

    Please Login or Register  to view this content.
    rather depends on what you want to do once found

  5. #5
    Registered User
    Join Date
    06-10-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Match Function - Finding The Last Instance

    That's great, thank you very very much

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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