How to compare and eliminate un-needed columns

dixiebritt

Board Regular
Joined
Jan 8, 2014
Messages
63
I have 2 spreadsheets. One spreadsheet has the following:
Last NameFirst NameSocial
DoeJane123-45-6789
SmithJohn111-11-1111
AppleseedJohn555-55-5555

<tbody>
</tbody>

And another Spreadsheet has a list of names (all in DB) with their address.

Last NameFirst NameAddressCityStZip
DoeJane
DoubtfireLaura
SmithJohn
AppletonTammy
AppleseedJohn

<tbody>
</tbody>

I am needing a way to merge the 2nd table to the first table, only bringing the data for those who have "matching last and first names). There are thousands of lines of data, so hoping there is a way of doing this a bit more simply than manually going through each.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
You can use a VLOOKUP. The first thing you need to do, however, is to create a key field in both spreadsheets consisting of both of the name fields.

In your example above, the key field might be "DoeJane", "SmithJohn", and "AppleseedJohn". You can accomplish this with the concatenation operator &.

Then, use a VLOOKUP from one spreadsheet to the other, looking up the key field and outputting the particular column of data you want.
 
Upvote 0
try PowerQuery

Table10Table11Result
Last NameFirst NameSocialLast NameFirst NameAddressCityStZipLast NameFirst NameSocialAddressCityStZip
DoeJane123-45-6789DoeJaneDoeJane123-45-6789
SmithJohn111-11-1111DoubtfireLauraSmithJohn111-11-1111
AppleseedJohn555-55-5555SmithJohnAppleseedJohn555-55-5555
AppletonTammy
AppleseedJohn

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table10"]}[Content],
    #"Merged Queries" = Table.NestedJoin(Source,{"Last Name", "First Name"},Table11,{"Last Name", "First Name"},"Table11",JoinKind.LeftOuter),
    #"Expanded Table11" = Table.ExpandTableColumn(#"Merged Queries", "Table11", {"Address", "City", "St", "Zip"}, {"Address", "City", "St", "Zip"})
in
    #"Expanded Table11"[/SIZE]
 
Upvote 0

Forum statistics

Threads
1,215,071
Messages
6,122,963
Members
449,094
Latest member
Anshu121

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