SOLVED
Home

Combine Tables

%3CLINGO-SUB%20id%3D%22lingo-sub-863126%22%20slang%3D%22en-US%22%3ECombine%20Tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-863126%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20to%20combine%20the%20data%20in%20columns%20A%20and%20B%20with%20the%20data%20in%20columns%20D%20and%20E%20based%20on%20the%20matching%20data%20in%20columns%20B%20and%20D.%20I%20need%20the%20data%20in%20columns%20A%20and%20E%20to%20be%20repeated%20for%20each%20match.%20Example%20of%20output%20needed%20is%20in%20columns%20G-I.%20Any%20help%20is%20greatly%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-863126%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-863264%22%20slang%3D%22en-US%22%3ERe%3A%20Combine%20Tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-863264%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F411805%22%20target%3D%22_blank%22%3E%40Heather560%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEasiest%20way%20is%20with%20Power%20Query%20-%20query%20separately%20both%20range%2C%20merge%20them%20and%20return%20result%20back.%20Please%20see%20in%20Sheet2%20attached.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-863275%22%20slang%3D%22en-US%22%3ERe%3A%20Combine%20Tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-863275%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3BThank%20you%20so%20much!%20Care%20to%20share%20how%20you%20did%20it%3F%20I%20am%20not%20familiar%20with%20power%20query.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-863698%22%20slang%3D%22en-US%22%3ERe%3A%20Combine%20Tables%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-863698%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F411805%22%20target%3D%22_blank%22%3E%40Heather560%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20which%20Excel%20version%20you%20are%3F%20Power%20Query%20is%20built-in%20into%20Excel%202016%20and%20later%2C%20for%202010%20and%202013%20you%20shall%20download%20and%20install%20Power%20Query%20add-in.%3C%2FP%3E%0A%3CP%3ENext%20step%20it's%20better%20to%20transform%20your%20data%20into%20Excel%20tables.%20Stay%20within%20range%2C%20Ctrl%2BT%2C%20Okay.%20You%20will%20have%20Table1%20and%20Table2%20by%20default%2C%20but%20could%20rename%20if%20you%20wish.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENext%20query%20your%20data%20-%20stay%20on%20table%2C%20on%20ribbon%20Data-%26gt%3BFrom%20Table.%20Power%20Query%20editor%20will%20be%20opened.%20Do%20nothing%20but%20File-%26gt%3BClose%20and%20load%20to-%26gt%3BAs%20Connection.%3C%2FP%3E%0A%3CP%3ERepeat%20with%20second%20table.%3C%2FP%3E%0A%3CP%3EIn%20right%20pane%20Queries%20and%20Connections%20double%20click%20on%20first%20query%2C%20it%20will%20be%20opened.%20Find%20in%20menu%20Merge-%26gt%3BMerge%20as%20New%20query.%20Select%20second%20query%20to%20merge%20with%2C%20and%20for%20each%20column%20on%20which%20you'd%20like%20to%20join.%20Select%20type%20of%20connection%20(inner%20join).%20Okay.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20Close%20and%20Load%20to-%26gt%3BTable.%20Select%20location%20for%20the%20table.%20Okay.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20your%20case%20that's%20quite%20simple%20and%20doesn't%20require%20deep%20knowledge%20of%20Power%20Query.%20But%20it%20worth%20to%20learn%20more%2C%20the%20tool%20is%20quite%20powerful.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Heather560
New Contributor

I need to combine the data in columns A and B with the data in columns D and E based on the matching data in columns B and D. I need the data in columns A and E to be repeated for each match. Example of output needed is in columns G-I. Any help is greatly appreciated.

 

 

3 Replies
Solution

@Heather560 

Easiest way is with Power Query - query separately both range, merge them and return result back. Please see in Sheet2 attached.  

@Sergei Baklan Thank you so much! Care to share how you did it? I am not familiar with power query.

@Heather560 

On which Excel version you are? Power Query is built-in into Excel 2016 and later, for 2010 and 2013 you shall download and install Power Query add-in.

Next step it's better to transform your data into Excel tables. Stay within range, Ctrl+T, Okay. You will have Table1 and Table2 by default, but could rename if you wish.

 

Next query your data - stay on table, on ribbon Data->From Table. Power Query editor will be opened. Do nothing but File->Close and load to->As Connection.

Repeat with second table.

In right pane Queries and Connections double click on first query, it will be opened. Find in menu Merge->Merge as New query. Select second query to merge with, and for each column on which you'd like to join. Select type of connection (inner join). Okay.

 

Now Close and Load to->Table. Select location for the table. Okay.

 

In your case that's quite simple and doesn't require deep knowledge of Power Query. But it worth to learn more, the tool is quite powerful.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
16 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
11 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies