Skip to content

Combining workbooks (no function)

This method uses Power Query’s From Folder connector. It works best when the workbooks share a layout and the data needs little or no reshaping.

It has three parts:

  1. Put all the workbooks in one folder.
  2. Connect Power Query to that folder.
  3. Keep only the Content column, and let Combine Files append the files.

Each workbook in this example has a single header row above its data:

A workbook with Date, Product and Qty columns and one header row

There are three workbooks, one for each period, all in the same folder:

A folder holding three workbooks named Book 1, Book 2 and Book 3

  • In a new, blank workbook, choose Get Data ➔ From File ➔ From Folder.

Excel’s Get Data menu open at From File, with From Folder highlighted

  • Browse to the folder and click OK, then click Transform Data in the window that follows.

The query has a row for each file and many columns, most of them details about the file such as its name and dates. Only the first column, Content, is needed here, because it holds each file’s contents.

  • Right-click the Content column header and choose Remove Other Columns.

The right-click menu on the Content column, with Remove Other Columns highlighted

  • Click the Combine Files button at the right of the Content column’s header.

The Content column with a Binary on each row, and the Combine Files button’s tooltip

  • In the Combine Files dialog, leave the Sample File as First file, select Sheet1, and click OK.

The Combine Files dialog with First file as the sample file, Sheet1 selected and a preview of its Date, Product and Qty data

Power Query then creates the helper queries and the function it needs, and adds the steps that append the files:

The Power Query Editor with helper queries, a Transform File function and the combined Date, Product and Qty data in the Source Files 2 query

If any column has the wrong data type, select it and change the type. Then choose Close & Load to load the combined data to Excel.