Use INDEX and AGGREGATE
Use aggregate to determine the row number that matches your criteria or the second or the third. In your case second. AGGREGATE performs array like operations so you will want to avoid using full column references.
=AGGREGATE(14,6, row(range of interest)/(true condition check(range of interest)*true condition check n (range of interest)),2)
14 tells AGGREGATE to sort an array of results from smallest to largest.
6 tells AGGREGATE to ignore any errors and exclude them from the array of results)
ROW(range of interest) will return the row number corresponding to the current calculation
Condition check will be some formula you come up with that returns a TRUE or FALSE result. If it is false it will result in a divide by 0 calculation which the 6 will tell aggregate to ignore. You can apply multiple conditions and separate them by a * which will act as an AND function.
2 tells AGGREGATE to return the 2nd result in the sorted array. So in this case it should be the second row number that matches your results.
The next thing to do is to place the AGGREGATE function inside of INDEX so it returns the information you want. Since INDEX does not perform array like calculations, it is safe to use full column references. Lets say your time stamp is in column B. You index formula would look something like:
=INDEX(B:B,AGGREGATE())
So in the end assuming your ID was in the A2:A8 range and your time stamp was in the B2:B8 range And the ID code you were looking for was in C1, your formula might look like:
=INDEX(B:B,AGGREGATE(14,6,ROW(A2:A8)/(A2:A8=C1),2)
Now if you want to add a bit of error checking you could includ the IFERROR function and make it look like:
=IFERROR(INDEX(B:B,AGGREGATE(14,6,ROW(A2:A8)/(A2:A8=C1),2),"Could NOT find the darned thing")
Are the timestamps in a single column or are they in multiple columns going across? – Nayrb – 2017-11-09T20:17:29.313
Time stamps are all in a single column, separate rows. So in the case of the example, the Unique ID would be identical in all 4 rows, with a different corresponding time stamp for each – Derek – 2017-11-09T20:27:14.003