I get seven workbooks (xlsx files) from different clients, each with one sheet.
Each sheet has at least one common ID column (UNIQ, PK). One of the workbook contains list of all possible ids. Others may not have record for all ids, but each row has id value defined.
I need to make a final workbook, with first column ID and then union of all remaining columns from each file.
Then I need to send the final.xlsx
via email, so its independent of the source files (I'm not sure if its possible to dereference it while retaining the constant values).
Can we do this using VLOOKUP
or built-in Excel functions?
On the Data tab, under Tools, click Consolidate. In the Function box, click the function that you want Excel to use to consolidate the data. In each source sheet, select your data, and then click Add. The file path is entered in All references.
Define name for the first excel table (Formulas tab -> Define name) Define name for second excel table. Go to Data tab, select "From Other Sources", and from the dropdown, select "From Microsoft Query" Select your workbook file and confirm that you want to merge the columns manually.
If you are going to perform this operation only once. You can do it like this:
Also, if this is something you have to do very frequently & the steps remain same. I'd suggest that before starting, you click on Record Macro, then perform above steps, tweak that code a little, save it in some other file for future & from next time you won't have to do it manually.
In case you would like to try different approach, take a look at the "Excel Query Wizard" https://superuser.com/questions/722348/merge-and-combine-in-excel/747430#747430
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With