Remove Duplicates and Find and keep the Most Recent Report

Grimm127

Board Regular
Joined
Aug 17, 2011
Messages
132
I have a data base that has over 200k rows.
They are individuals that have been termed from the company.
The issue is that from multiple reports I merged together, I have the same Employee showing up multiple times based on the fact the reports that the data came from shows him up more than one.

So, I am trying to remove the duplicate Employee and only keeping the most recent term date for the employee. So in the example below I want to keep only the second from last which is file 9 which is the most recent file. I have employees that show up only twice and some showing up 6. It varies based on the number of reports I merged into the file. Is there a formula to look at the name then id which file for me to keep or delete. Since the DB is so huge I can't think of an easier method because filters don't work and slow my computer to a crawl. I appreciate any advice. Thanks

EE_NAME EMPLOYEE_NUMBER ACTUAL_TERMINATION_DATE FILE EE COUNT FILE REF
Abbott, Costello 123456 15-Jan-16 TERMS_2015 9 1
Abbott, Costello 123456 15-JAN-16 TERMS_YTD_01APR2016 9 3
Abbott, Costello 123456 15-JAN-16 TERMS_YTD_06JUN2016 9 7
Abbott, Costello 123456 15-JAN-16 TERMS_YTD_12MAY2016 9 6
Abbott, Costello 123456 15-JAN-16 TERMS_YTD_14APR2016 9 4
Abbott, Costello 123456 15-JAN-16 TERMS_YTD_14JUN2016 9 8
Abbott, Costello 123456 15-JAN-16 TERMS_YTD_19APR2016 9 5
Abbott, Costello 123456 15-JAN-16 TERMS_YTD_22JUN2016 9 9
Abbott, Costello 123456 15-JAN-16 TERMS_YTD_22MAR2016 9 2
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
The EE count is the number of times that Employee shows up in the merged file. Yes the File Count will match the number of times the Employee will show up on this file. Since I created this file from several reports (9 total so far).
 
Upvote 0
What if you create a helper column called "Delete?" (let's say in column G). G2 will have the formula

=IF(E2=F2,"No","") Auto Fill this for all of column G. This should say "No" for each column that you want to keep.

Now copy column G, paste values, find & select, go to special, blanks, ok, right click on any of the selected blanks, delete, entire row.

If it doesn't see them as blanks after pasting values, you can highlight column G, Data, Text to Columns, Finish. Then find & select...
 
Last edited:
Upvote 0
What if you create a helper column called "Delete?" (let's say in column G). G2 will have the formula

=IF(E2=F2,"No","") Auto Fill this for all of column G. This should say "No" for each column that you want to keep.

Now copy column G, paste values, find & select, go to special, blanks, ok, right click on any of the selected blanks, delete, entire row.

If it doesn't see them as blanks after pasting values, you can highlight column G, Data, Text to Columns, Finish. Then find & select...

Yes, that way it Matches the Employee Count to the most recent report. I will give it a whirl. Thanks man. I had a brain fart and couldn't think of anything.
 
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,113
Members
452,545
Latest member
boybenqn

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