Merge and consolidate Multiple Excel Workbooks problem

AndersNK

New Member
Joined
Aug 3, 2017
Messages
2
Hi, I’ve been trying to make a power query to merge two tables and keep them updated with new inputs every month. Hope that its not too confusing.
The idea is as follow:

1. Two separate tables, with one common column (EAN number), is imported into to individual queries by adding a custom column with the formula: "Excel.Workbook([Content])" - This is done for both of the tables and makes it possible for me to just drag and drop a raw excel file into a specific folder on my desktop and thereby update the table

2. Transform the imported table into a desired format. For both tables I will keep the filename in one column, which shows the month for the specific data.

3. Merge the transformed tables into one.

When this is done multiple records for the same month is created, because they are merged by EAN, meaning that e.g. EAN 1 for January (from the first table) is merged with both EAN 1 for January, February and marts (second table). So if I have data for three months, there will be six samples of each EAN - instead of three

4. To avoid this a conditional column is added with an if formula which says: If "the month from table 1" is the same as "the month from table 2" Then “conditional column=month from table 1”, Else it says "duplicate"

5. Then all "duplicates" is sorted out so that the only rows left is where table 1 is merged which table 2 correctly (same month)

All this works fine. The problem happens when one of the EAN's is only represented in one of the tables as they will not be merged.

Any ideas for how this can be solved?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Seems complicated. Why don't you just do a multi column merge by selecting the EAN and month column in the wizard?
 
Upvote 0
Well, that actually seems to work... Guess i was just blinded by my one "brilliant" solution. Thanks alot :)
 
Upvote 0

Forum statistics

Threads
1,223,881
Messages
6,175,159
Members
452,615
Latest member
bogeys2birdies

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