You are here:

Excel/oldest and latest dates for unique list


Hi, Tom

Given the data below, is there a formula to determine the oldest and latest dates for a to e as shown below?

e   10-Jan-59
a   10-Feb-70
e   23-Apr-70
b   24-Jan-75
c   10-Feb-12
d   23-Mar-13
e   5-Apr-15
a   6-Apr-15
c   7-Apr-15
d   8-Apr-15
c   9-Apr-15
d   10-Apr-15
a   11-Apr-15
c   12-Apr-15
b   13-Apr-15
d   14-Apr-15
b   15-Apr-15
d   16-Apr-15
e   17-Apr-15
a   18-Apr-15
c   19-Apr-15
d   20-Apr-15
c   21-Apr-15
d   22-Apr-15
a   23-Apr-15
c   24-Apr-15
b   25-Apr-15
d   26-Apr-15
e   27-Apr-15
b   28-Apr-15
e   29-Apr-15
a   30-Apr-15
c   1-May-15
e   2-May-15
c   3-May-15
b   4-May-15

  Oldest          Latest
a   10-Feb-70   23-Mar-13
b   24-Jan-75   10-Apr-15
c   10-Feb-12   19-Apr-15
d   23-Mar-13   27-Apr-15
e   10-Jan-59   4-May-15

Many thanks

Sydney, Australia


assume A1:A36 holds your letters and B1:B36 holds your dates

D1: a
D2: b
D3: c
D4: d
D5: e

E1:  =MIN(IF($A$1:$A$36=$D1,$B$1:$B$36,100000)*1)   entered with Ctrl+Shift+Enter rather than just enter since this is an array formula
F1:  =MAX(IF($A$1:$A$36=D1,$B$1:$B$36,-1)*1)  entered with Ctrl+Shift+Enter rather than just enter since this is an array formula

Format both E1 and F1 as  dd-mmm-yy

then select E1:F1 and drag fill down to E5:F5

that produced this output:  

a   10-Feb-70   30-Apr-15
b   24-Jan-75   4-May-15
c   10-Feb-12   3-May-15
d   23-Mar-13   26-Apr-15
e   10-Jan-59   2-May-15

My oldest dates agree with yours, but my latest dates don't.  However, your latest dates appear to be wrong.   

Tom Ogilvy  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2017 All rights reserved.