Match & Merge Data From 2 Spreadsheets

meir0082

New Member
Joined
Apr 19, 2016
Messages
4
Hi I have 2 spreadsheets, I need to only merge data from one when there is matching data in a cell in the other. Is there any way to do this? Example:
Table A

CodeName
AAA111A
BBB111B
CCC111C

Table B
CodeName
AAA111A
CCC111C
DDD111D

I only want excel to pull AAA111 and CCC111 but skip BBB111 as the is no matching data in table b
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Load each table to Power Query Editor and then Join the tables with a left outer join on the Code

Power Query:
let
    Source = Table.NestedJoin(TableA, {"Code"}, TableB, {"Code"}, "TableB", JoinKind.LeftOuter),
    #"Expanded TableB" = Table.ExpandTableColumn(Source, "TableB", {"Code", "Name"}, {"TableB.Code", "TableB.Name"})
in
    #"Expanded TableB"

Book8
ABCDEFGHIJ
1CodeNameCodeNameCodeNameTableB.CodeTableB.Name
2AAA111AAAA111AAAA111AAAA111A
3BBB111BCCC111CCCC111CCCC111C
4CCC111CDDD111DBBB111B
Sheet1
 
Upvote 0

Forum statistics

Threads
1,215,484
Messages
6,125,066
Members
449,206
Latest member
Healthydogs

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