r/ExcelPowerQuery • u/LionsAndViolets1851 • Sep 10 '24
Merging files from a folder
I have a file for each month that has accounts in column A and the balance at the end of the month in column B. I would like to merge these files using power query to create a table with the accounts in column A and then say the balance of January from file 1 in column B and the balance for February from file 2 in column C and so. Is this possible? Could someone point me to a resource that would show me how to do this?
Thanks!
1
u/declutterdata Sep 11 '24
Hi LionsAndViolets,
beautiful name by the way. 😊
Glad to help you.
There are a few variables here.
I made you an example, but it is tough to replicate your scenario. There are many variables
Is the output file in the folder of the data or it is separate -> I placed it in the same folder. If wished that it should be out of it the query has to be adjusted
How are the files named? If numbers are used (January -> 01, February -> 02, ...) sorting is easy. In case of names we have to make a rule. I used 2nd method and made a rule just for clarification. -> If wished that it should be with numbers the query has to be adjusted. (Rule has to be reversed).
How many sheets are in the files and what is their name -> Maybe we need filtering
And the list goes on.
Link for the example files:
LionsAndViolets1851 - Merging files from folder.zip
So I hope the example will help you to understand how it can work. If you need further assistance just send me a DM.
Regards,
Phillip from DeclutterData 🙋🏻♂️
1
u/recursivelybetter Sep 10 '24
possible, youre looking for Merge Inner, it just needs the column thars common in two tables and it will match what was found