Merging - adding one column from one file to a larger data set when rows don't match up

alspeegle

New Member
Joined
Jan 14, 2014
Messages
1
Hi, friendly Excel Gurus...

I have two very large data sets that I need to merge. One contains approx. 10,000 ID numbers in Column A, with multiple columns of data for each. The second contains a subset of these ID numbers, and one column of useful data. I need to tack this one column of data onto the other spreadsheet such that the ID numbers remain associated with the correct data. That is, I can't just cut and paste the column into the larger spreadsheet, as the ID numbers are not in the same order, and there isn't an entry in the second sheet for every ID number in the first sheet. Accurately cross-referencing the data to the IDs is absolutely critical, but not feasible by hand for a set this large!

I hope I've explained this clearly... I am fairly new to VBA, but a quick learner, so I thank you in advance for your time (and patience)!

Amy
 

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.
Hi Amy,

My suggestion would first be to add a ID lookup column at the end of your master data set. This column would look up which row in your second sheet has the matching ID number.

Let's assume this formula is in Column M.

Code:
=iferror(match(A1, Sheet2!$A:$A, 0), "-")

Then using this row number I would lookup your extra useful column (let's assume its in Col B of Sheet2)

Code:
=if(M1="-", "-", index(Sheet2!$B:$B, M1))

Hope this helps.

Dean.
 
Upvote 0
alspeegle,

Welcome to the MrExcel forum.

What version of Excel and Windows are you using?


1. Are both data sets in the same worksheet?
2. Or, is each data set in its own worksheet?


Can you post a screenshot of the actual raw data worksheet(s)?

And, can you post a screenshot of the worksheet results (manually formatted by you) that you are looking for?

To post your data, you can download and install one of the following two programs:
Excel Jeanie
MrExcel HTML Maker

Or, when using Internet Explorer, just put borders around your data in Excel and copy those cells into your post.
See reply #2 the BLUE text in the following link:
http://www.mrexcel.com/forum/about-board/444901-how-create-table-like-aladin.html#post2198045


If you are not able to give us screenshots:
You can upload your workbook to Box Net,
sensitive data changed
mark the workbook for sharing
and provide us with a link to your workbook.
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,915
Members
448,532
Latest member
9Kimo3

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