Find and delete dupes from different years

bobkap

Active Member
Joined
Nov 22, 2009
Messages
313
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
I have a rather large set of data. (Short example below) I need to create a macro to do the following:
1. Look for duplicates that show the year 2 years apart. In other words, In the case below, we need only to find duplicate first and last names from 2018 and 2020, regardless of the day and month.
2. Once we find a duplicate we need to delete BOTH the 2018 and 2020 record.
3. End result is that we just want to keep 2018 records that DO NOT show up with a 2020 date.
4. While we're at it, remove all 2019 records.
5. With my limited knowledge of Power Query, I thought that this would be a perfect tool for this. But, the goal is to hand this off to users with very limited knowledge of how to use Excel so I thought a macro would be the best route to take as they would only have to enter a few key strokes to get their desired end result.

1599260129507.png


Any help would be greatly appreciated.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
in short
- filter for 2018
- remove duplicates
is that what you want?
 
Upvote 0
Kind of. Say there is a dupe in 2018 and 2020. We need both removed.
 
Upvote 0
Sorry. End result would be that we only have 2018 records left. So, any record with a 2020 date but no 2018 dupe needs to be deleted.
Thanks!
 
Upvote 0
End result would be that we only have 2018 records left. So, any record with a 2020 date but no 2018 dupe needs to be deleted
so that is what I said, filter 2019 and 2020 out and remove duplicates from 2018
end result is 2018 without duplicates
see post#2

btw. your example is not representative
 
Upvote 0

Forum statistics

Threads
1,215,011
Messages
6,122,677
Members
449,092
Latest member
tayo4dgacorbanget

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