Comparing Two Data Sets

jones273

New Member
Joined
Nov 10, 2014
Messages
1
Hi all!

I am working with two different data tables. Data Set A has 2 columns and Data Set B has 4 columns. The 2 columns in Data Set A are the same information as the first 2 columns in Data Set B. I am looking for some guidance as to how create a macro that finds exact matches between A & B. More specifically, if BOTH columns of a row (A1 & B1) in Data Set A are found in Data Set B, I want a new table created with all four cells from the matching row in Data Set B.

EX.

Below is a line from both columns of Data Set A (A1 & A2) and all four columns from what would be considered a match in Data Set B.


A1A2B1B2B3B4
767MSY767MSY1-11-20141-12-2014

<tbody>
</tbody>


<tbody>
</tbody>

Thanks for your help and let me know if you need more information!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Create a third column of Data in Data set A it will use this formula ...fill it down
=CONCATENATE(A1,B1)

Add this formula to the fifth column in Data set B.........fill it down

=IF(ISNA(VLOOKUP(CONCATENATE(A1,B1),Sheet2!C:C,1,0)),"","X")
Change the "Sheet2" to the name of Data set A

Then filter Data Set B by Column 5 for all "X"

Copy-paste-special to a new work book to create your new dataset.
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,212
Members
449,214
Latest member
mr_ordinaryboy

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