How are you wanting to "see" the earliest of the two records? How are you searching?
How much control over the file do you have? If you sorted the file by uniqueId, Date, then time, you could use vlookup to look up the uniqueId and return the date, then a second vlookup to return the time. vlookup would only return the first occurence. If you're wanting a more programmatica (VBA) solution, you could read through the data and store it in a dictionary item. compare the date/time and store only the earliest. lots of ways... how do you WANT it to work? Paul ________________________________ From: Lee <rad...@progressivetel.com> To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com> Sent: Friday, July 24, 2009 9:28:29 AM Subject: $$Excel-Macros$$ Need earliest record based in unique identifier I have a bunch of test data. Column A is the date, Column C is the time and Column E is the unique identifier. Because this is test data, a failed unit might be tested multiple times. What I need is a way to find the earliest test time of the unique identifier in Column E. How do I restrict the data to return me the earliest date and time for a unique unit from Column E, when the date and time are in two separate columns? Column A Column B Column C Column D Column E 12-Mar-08 XXXXXXX 15:22:25 XXXXXXXX 12345678 12-Mar-08 XXXXXXX 15:25:25 XXXXXXXX 12345679 12-Mar-08 XXXXXXX 15:28:27 XXXXXXXX 12345680 12-Mar-08 XXXXXXX 15:32:45 XXXXXXXX 12345681 12-Mar-08 XXXXXXX 16:22:25 XXXXXXXX 12345678 12-Mar-08 XXXXXXX 16:25:25 XXXXXXXX 12345679 12-Mar-08 XXXXXXX 15:28:27 XXXXXXXX 12345698 12-Mar-08 XXXXXXX 15:32:45 XXXXXXXX 12345699 In the example above there are two duplicates (12345678, and 12345679). I would only want to see the earliest of the two records based on the identifier in column E. Thanks! Lee --~--~---------~--~----~------------~-------~--~----~ ---------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 5,200 subscribers worldwide and receive many nice notes about the learning and support from the group. Our goal is to have 10,000 subscribers by the end of 2009. Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe -~----------~----~----~----~------~----~------~--~---