Removing duplicate records based off of date
Hello Jen,
I hope that I can help you. It is a long winded explanation but in reality
it does not take very long to complete once you know what to do.
I am not sure how much help you need with this so I will provide all
instructions so hopefully you dont lose time getting back because you dont
understand. (But feel free to get back if anything you dont understand)
Ensure you have a backup of your workbook before commencing this.
Use Advanced Filter to create unique list of record numbers as follows.
Select the record numbers including the column header.
Select Advanced Filter. (See Help for more info in Advanced Filter)
Check Copy to another location.
Check Unique records only.
Click icon at right of Copy to field.
Select a cell directly below the bottom of the record number data in the
same column (that is column A)
Click the icon at right of displayed field to get back to main dialog box.
Click OK.
Select all of the original data including column headers (but dont include
the unique data) and sort on the date in descending order (Most recent date
to top). (Ensure that you check box that your data has column headers.)
Go back down to your new unique list of record numbers.
In the cell in column B adjacent to first record number enter the the
Vlookup formula. (Note that I have used column(B:B) as the column index
number. This is so it becomes relative for the remaining columns in your data)
=VLOOKUP($A20,$A$2:$D$7,COLUMN(B:B),FALSE)
You will need to edit your row number for the lookup value and table array
will be your entire table of original data excluding the column headers. Note
that the lookup value $A20 has the preceding $ sign before the column but NOT
before the row. The table array is totally absolute with preceding $ signs
before the columns and rows. COLUMN(B:B) actually returns the column number
which for column B is 2.
You should be able to copy the formula to the bottom of the unique list of
record numbers and across to the last column of your other data.
Vlookup uses the first value that it finds so with the dates sorted in
descending order, it will be the most recent date.
Before deleting your original data ensure that the new data is correct.
Then select all of the new data and Copy - Paste Special - Values before
you delete the original data.
--
Regards,
OssieMac
|