My most recent one was merging two tables, where the column identifying the same person in each table wasn't identical. Each had people that weren't listed on the other. Searching online turned up no walkthroughs, only third-party plugins to Excel that cost in excess of $40. Not wanting to cost my employer money to perform this task, I kept working on it. Finally found a similar solution on this page (credit where credit is due) from an "Anne Troy":
http://forums.techguy.org/business-applications/139190-merging-tables-access.html
Here is the walkthrough, in my own words. Hopefully this is useful to somebody out there - I'm hoping Google picks it up in its search results to help others out there with this same challenge.
Make sure both tables are in the same Workbook in different Sheets.
Step One: Add rows from new sheet that don’t already exist in the Master
- Sort the Master sheet in ascending order by the identifying column
- Sort the new sheet in ascending order by the identifying column
- Define a name for the identifying column in the Master sheet – call it “Master”
- Add a column to the right of the new sheet
- Enter this formula, and copy down:
=VLOOKUP(A2,Master,1,FALSE)
Where A is the column that contains the identifying value and the first column in the Master area is the column with the same identifying value - Sort by the new column so that all #N/A values come together
- Copy all the #N/A rows with only the identifying value into the Master sheet
- Delete the new column with the formula result
Step Two: Merge data into Master
- Re-sort the Master sheet in ascending order by the identifying column
- Re-sort the new sheet in ascending order by the identifying column
- Create a new column in the Master for the new data
- Define a name for the table to be merged into the Master – call it “MyData”
- Enter this formula in the new column in the Master and copy down:
=IF(ISNA(VLOOKUP(A2,MyData,2,FALSE)),"",VLOOKUP(A2,MyData,2,FALSE))
Where A is the column that contains the identifying value in the Master and the second column in the new data sheet contains the data that needs to be merged in - Copy all cells, then paste over them using the Paste Special -> Values
No comments:
Post a Comment