Recognising a group of records and identify the oldest

XLmuppet

New Member
Joined
Aug 13, 2014
Messages
16
Office Version
  1. 365
Platform
  1. Windows
I have a large table of records which all have a unique key but many of which are duplicated. They all have a date created field too. I would like to try to write a formula (I can try VBA but lack any knowledge or talent here) to add a note to the third column which I have labelled as "Action" which will either be 'Keep' or a 'date' to delete. based on identifying similar records via the Key and keeping the oldest whilst adding a date to delete to any more recent i.e

KEYCreatedAction
37059603/05/2018Keep
42512803/05/2017Keep
42512816/09/201701/05/2020
42512823/09/201701/05/2020
47552107/05/2018Keep
47552101/10/201801/05/2020
47552117/09/201901/05/2020

Please can anyone help?

Julian
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Try:

Book1
ABCDE
1KeyCreatedActionCleanup date
23705965/3/2018KeepKeep5/1/2020
34251285/3/2017KeepKeep
44251289/16/20175/1/20205/1/2020
54251289/23/20175/1/20205/1/2020
64755215/7/2018KeepKeep
747552110/1/20185/1/20205/1/2020
84755219/17/20195/1/20205/1/2020
Sheet13
Cell Formulas
RangeFormula
C2:C8C2=IF(B2=MINIFS(B:B,A:A,A2),"Keep",E$2)
D2:D8D2=IF(B2=MIN(IF(A$2:A$8=A2,B$2:B$8)),"Keep",E$2)
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.


MINIFS came along in Excel 2016 I believe. If your version doesn't have it, try the D2 formula instead.
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,499
Members
449,089
Latest member
Raviguru

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