+ Reply to Thread
Results 1 to 11 of 11

Return Last the record entered for a specific name.

  1. #1
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Return Last the record entered for a specific name.

    The data is a listing of Formula 1 races (year, race and driver). I want to return the first race listed for each driver as well as the last race.

    The attached file shows how the data is arranged. Using "Index" I am able to return the first record for each name but I also need to return the last record as well.

    I have done some web searches to no avail. The dataset is over 20000 rows and I wish to have it dynamically update.

    Thank you
    Jim O
    Attached Files Attached Files
    Last edited by JO505; 09-12-2014 at 03:57 PM.

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,177

    Re: Return Last the record entered for a specific name.

    You wont find anything in web searches because this is a Database operation.
    Now, you could run a pivot table on the data, and get Max & Min of year for each driver.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Return Last the record entered for a specific name.

    Can you swing your table round to go from earliest to latest? That will make things easier, you can then use your INDEX/MATCH to find the 1st match.

    Use this for the latest date...
    =MAX(IF(Table1[Driver]=$K4,Table1[Year],0))
    and this for the venue
    =INDEX(Table1[Race],MATCH(MAX(IF(Table1[Driver]=$K4,Table1[Year],0))&K4,Table1[Year]&Table1[Driver],0))

    Both lof these are ARRAY formulas, entered using CTRL SHIFT ENTER, not just enter
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Return Last the record entered for a specific name.

    FDibbins,

    Thanks for the response and the formulas. They both work perfectly. I do have the data sorted from earliest to latest in my data file I just forgot to sort it in my example.

    Again thanks to both for your time.

    Jim O

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Return Last the record entered for a specific name.

    Happy to help

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Return Last the record entered for a specific name.

    FYI

    Iterative calculation was turned on for this workbook and I turned it off which should aid calculation speed.

    If you don't want to use the helper column, this will work for you.
    Attached Files Attached Files
    Last edited by newdoverman; 09-12-2014 at 05:29 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  7. #7
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Return Last the record entered for a specific name.

    I ran into an issue with the formula (see the partial list). It will pick up the last year fine but it returns the first race in that year. I need to match the name for the last race in the year. I am trying to avoid going back through all 24412 rows to enter an exact date if their is another way.

    Jim O
    Attached Files Attached Files

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Return Last the record entered for a specific name.

    How can you tell what the first or last race is as there are no dates attached to the races? In the example, some driver's first race is their last race. With anything more than 1 race, there is nothing to identify first from last or anything in between.

  9. #9
    Forum Contributor
    Join Date
    05-10-2011
    Location
    Central Ohio
    MS-Off Ver
    Excel 2000, and 2010
    Posts
    654

    Re: Return Last the record entered for a specific name.

    I was afraid of that. I was hopping their was some way to count from the bottom up as the races are in the order ran. I have the dates for each race but they are in another table I guess I will just have to add them to this file and go from there.

    Thanks for the response.

    Jim O

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Return Last the record entered for a specific name.

    Actually, if the races are all in the correct sequence, maybe there is (using countifs in a helper). I dont have time right now, but IU will take another look later

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Return Last the record entered for a specific name.

    If the races are indeed in order, this will find the last race for each driver (as much as I can determine right now) using the order of the drivers in column J or column K (on your worksheet....whichever has the names)

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This is assuming the race order is as shown in this example.
    Attached Files Attached Files

+ 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] Insert Row and Record in Another Sheet Once I entered date
    By atulexel79 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-22-2014, 10:04 AM
  2. [SOLVED] Find Specific Record And Return A Value
    By Wycliffslim in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-29-2014, 02:14 AM
  3. Replies: 14
    Last Post: 10-07-2013, 04:04 PM
  4. VBA code continues to return to specific cell after data is entered
    By celialynn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2012, 08:36 PM
  5. Ensure that a unique record is entered
    By Rocketman66 in forum Excel General
    Replies: 1
    Last Post: 07-15-2010, 05:47 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