Choose the result you want first
The right way to combine Excel files depends on what the finished workbook should contain.
| Desired result | Suitable method | Example |
|---|---|---|
| Add rows with the same columns below one another | Power Query Append or folder combination | January through December sales |
| Add columns by matching a shared identifier | Power Query Merge | Add department details by employee ID |
| Collect several worksheets in one workbook | Move or copy worksheets | Keep separate sheets for each branch |
| Stack a few ranges vertically once | Copy and paste, or VSTACK | Combine small lists |
Use folder combination when you want the same table from each monthly file to become one dataset. If you only want to collect worksheet tabs in one file, you do not need Power Query.
The folder requirements and missing-file checks below summarize Microsoft’s official help. They are not results from importing or saving actual workbooks in an app trial. The service-guide button opens this article’s Korean original; related guides marked Korean are available in Korean.
Prepare the source files
- Create a new working folder and put only copies of the files you want to combine in it.
- Make column headings consistent across files, including spelling and spaces.
- Use consistent data types for each column, such as dates, numbers, or text.
- Use the same name for the worksheet or Excel table containing the data.
- Where possible, remove total rows, blank heading rows, and merged cells from the source data area.
Keep the result workbook and temporary files out of the source folder. If you save the result there, a later refresh can read it as another source and duplicate the data.
Prepare files with a consistent schema, including column names, data types, and column count. Microsoft says matching is based on column names, so the relative column order need not be identical. Distinguish between columns that still have the same names but have moved and columns whose names have changed. This does not mean you can combine unrelated schemas without any preparation.
Combine multiple files with Power Query
These steps use Windows desktop Excel. Do not assume Mac or Excel for the web has the same local-folder import menu. Microsoft’s source-availability table lists Local Folder refresh, without import, for Excel for Microsoft 365 for Mac. Web features and supported sources also depend on the account and plan; a SharePoint folder is a different source from a local Windows folder.
- Open a blank workbook.
- Choose Data → Get Data → From File → From Folder.
- Select the folder containing the prepared source files.
- Check that the file list contains the sources you intend to include. To combine the entire list, choose Combine & Transform Data.
- Select the Sample File and the object to import, such as a worksheet or table, within it. All objects in a workbook do not automatically become one table.
- In the Power Query Editor, remove unnecessary columns and check date and number types.
- Select Close & Load to load the result as a table on a new worksheet.
You can also choose Combine & Load at the start. If blank rows or column types vary between files, inspect the data in the transformation view first.
Filter by extension or subfolder
The folder’s file list can also include files in subfolders. Select the intended inputs before combining if backup folders or other file types are mixed in.
- In the folder’s file-list window, select Transform Data. This is different from immediately combining the whole list.
- In the Power Query Editor, filter Extension and Folder Path to retain only the files you need.
- Compare the remaining files with your expected source list.
- Select the Content column containing the files’ Binary values, then choose Home → Combine Files.
- Check the sample file, the object to import, and how to handle files with errors before combining.
The transformation steps are built around the sample file’s structure. Check whether you selected a worksheet or table that exists in only some files. Review which files remain as inputs, as well as the final table.
Check for missing data when skipping files with errors
Skip files with errors excludes affected files from the result. Finishing a load without errors does not establish that every intended source was included.
The following is a hypothetical example explaining the missing-file check. It is not output from an actual Excel transformation.
| Check | Hypothetical file count |
|---|---|
| Intended source files | 3 |
| Files left after folder and extension filters | 3 |
| Files skipped because of errors | 1 |
| Source files included in the result | 2 |
Here, even though a result table exists, one source file still needs to be accounted for. Identify the excluded file and why its transformation failed, correct the required source, then refresh and compare the result again. Record files excluded by filters separately from files skipped because of errors.
Include new files with Refresh All
Add new files with the same structure to the source folder, then choose Data → Refresh All in the result workbook. For a monthly task, keeping the table structure consistent matters more than the file names.
- Keep column headings unchanged.
- Keep source worksheet and table names consistent.
- Store the result workbook outside the source folder.
- When replacing files, avoid leaving old versions that would duplicate the data.
- Check folder and extension filters and the error-skipping setting to confirm that new sources are included.
- After refreshing, compare the total row count and monthly totals with the sources.
Merge columns using a common key
Use Merge Queries when two tables share a column, such as customer ID, product code, or employee ID, and you want to add information alongside the existing columns.
- Import both tables into Power Query separately.
- On the Home tab, select Merge Queries.
- Select the matching key columns in the same order in both tables.
- Choose the join kind you need. To retain the existing list, a left outer join is usually appropriate.
- Expand the merged column and select only the columns you want to bring in.
- Check duplicate keys and unmatched values that appear as nulls.
Leading or trailing spaces in keys, or differences between number and text data types, can prevent apparently identical IDs from matching. Clean the values and align data types before merging.
Collect worksheets in one workbook
- Open both the source workbook and the destination workbook.
- Right-click the tab of the worksheet you want to copy.
- Select Move or Copy.
- Choose the destination workbook and the position for the sheet.
- Select Create a copy to keep the original.
If the sheet contains formulas referring to other files, defined names, charts, or macros, check that the necessary links still work after copying. If your goal is simply to collect values, pasting values only may be a safer choice.
Check for errors and duplicates
- Are Excel temporary files whose names start with
~$still in the folder? - Are different extensions, such as CSV and XLSX, mixed together?
- Does the same transaction appear in more than one source file?
- Are column headings and the first data row in consistent positions?
- Were any dates imported as text?
- Do only some files contain total rows?
- Were subfolder backups included, or required files excluded by filters?
- Are any source files still being skipped because of errors?
- Do source totals and result totals agree after refreshing?
Before accepting the final table, compare the intended sources, the files left in the input list, the files actually included, and the files excluded. Then compare the combined row count and monetary totals. Repeat these checks whenever sources, filters, or transformation conditions change to catch missing or duplicate data in recurring combinations.
Official sources
- Microsoft — Import and combine files from a folder ↗
- Microsoft Learn — Folder connector, subfolders, and sample objects ↗
- Microsoft — Append and Merge produce different results ↗
- Microsoft — Merge keys, data types, join kinds, and expanded columns ↗
- Microsoft — Move or copy worksheets and check references ↗
- Microsoft — Power Query data sources by Excel version and platform ↗
- Microsoft — Power Query features and plan conditions on the web ↗
- Microsoft — VSTACK and supported Excel versions ↗
