Max and Min Dates multiple criteria

jingamells

New Member
Joined
Oct 1, 2010
Messages
37
I am trying to populate two columns with min and max dates based on multiple criteria matching (ID and Ref number).
I could probably do a multiple IF but sure there is a better way? B
elow is an extract of data. I am trying to populate the last two columns (first and last Appt date) with the values shown from the Appt date column when ID and ref number are the same

Many thanks in advance.

[TABLE="width: 522"]
<tbody>[TR]
[TD]ID
[/TD]
[TD]Appt Date
[/TD]
[TD]Ref_Date
[/TD]
[TD]Referral Number
[/TD]
[TD]First Appt Date
[/TD]
[TD]Last Appt Date
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]15/02/2016
[/TD]
[TD="align: right"]05/03/2014
[/TD]
[TD="align: right"]1
[/TD]
[TD="align: right"]04/04/2016
[/TD]
[TD="align: right"]15/02/2016
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]04/04/2016
[/TD]
[TD="align: right"]05/03/2014
[/TD]
[TD="align: right"]1
[/TD]
[TD="align: right"]04/04/2016
[/TD]
[TD="align: right"]15/02/2016
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]24/09/2015
[/TD]
[TD="align: right"]07/07/2015
[/TD]
[TD="align: right"]2
[/TD]
[TD="align: right"]24/09/2015
[/TD]
[TD="align: right"]19/10/2015
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]19/10/2015
[/TD]
[TD="align: right"]07/07/2015
[/TD]
[TD="align: right"]2
[/TD]
[TD="align: right"]24/09/2015
[/TD]
[TD="align: right"]19/10/2015
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]10/05/2016
[/TD]
[TD="align: right"]11/04/2016
[/TD]
[TD="align: right"]3
[/TD]
[TD="align: right"]10/05/2016
[/TD]
[TD="align: right"]10/05/2016
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]21/09/2016
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]21/10/2016
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]23/11/2016
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]08/02/2017
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]22/03/2017
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]29/03/2017
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]09/05/2017
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]31/05/2017
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]15/06/2017
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
[TR]
[TD]U0110951
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[TD="align: right"]19/08/2016
[/TD]
[TD="align: right"]4
[/TD]
[TD="align: right"]07/09/2016
[/TD]
[TD="align: right"]14/07/2017
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
1. If you have MINIFS, in E2 just enter and copy down:

=MINIFS($B$2:$B$17,$A$2:$A$17,$A2,$D2:$D$17,$D2)

Otherwise, in E2 control+shift+enter, not just enter, and copy down

=MIN(IF($A$2:$A$17=$A2,IF($D$2:$D$17=$D2,$B$2:$B$17)))

2. If you have MAXIFS, in F2 just enter and copy down:

=MAXIFS($B$2:$B$17,$A$2:$A$17,$A2,$D2:$D$17,$D2)

Otherwise, in F2 control+shift+enter, not just enter, and copy down

=MAX(IF($A$2:$A$17=$A2,IF($D$2:$D$17=$D2,$B$2:$B$17)))
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,123
Members
452,381
Latest member
Nova88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top