To import and combine multiple CSV files in Excel for Microsoft 365 on Windows, put the files in one folder, then select Data > Get Data > From File > From Folder. Choose the folder, select Combine & Transform Data, check the preview, and load the result; Power Query can then refresh the combined table as files are added or updated.
What importing from a folder does
Power Query reads files in a folder and applies a shared set of import and transformation steps to them. The usual result is one table with the rows from each CSV stacked together. For example, if January.csv contains 500 transaction rows and February.csv contains 420, combining them produces 920 rows, plus a header row in the query preview if the files have headers.
This is useful for recurring exports: weekly sales reports, monthly invoices, survey responses, or logs saved by another system. Instead of opening each file, copying its contents, and pasting them into a master sheet, you set up the query once and refresh it when the folder’s contents change.
The folder method is best when files have the same general layout. They do not have to contain identical data, but consistent column names, delimiters, and header rows make the result much easier to interpret. Power Query is combining records, not deciding which values are correct or reconciling differences in meaning.
Prepare the CSV files
Before connecting, create a dedicated folder for the files you want to combine. Keeping unrelated documents elsewhere reduces the chance that Power Query will try to process them. A clear naming pattern such as sales_2026-01.csv and sales_2026-02.csv also makes it easier to identify files and filter them later.
- Keep the same fields in each file where possible. A shared set of headers such as Date, Product, and Amount is easier to combine than changing headers each month.
- Use one header row, followed by records. Avoid title lines, blank rows above the headers, or totals at the bottom unless you intend to remove them in the query.
- Check that the CSV files use the same delimiter, such as a comma, and that text containing delimiters is properly quoted in the file.
- Choose a consistent date and number format. CSV stores text values, so Power Query may need to interpret dates, decimals, and currency values during transformation.
- Do not save the finished output CSV in the source folder. If it is picked up as an input file on a later refresh, its rows may be included again.
You can keep the folder on a local drive or in a synced location, provided the path is available when Excel refreshes. A network or cloud location can introduce access and sign-in considerations, so confirm that the person refreshing the workbook can reach the same source.
Import and combine the files in Excel
- In Excel for Windows, open the workbook that will contain the combined data and select Data > Get Data > From File > From Folder.
- Browse to the folder containing the CSVs and select Open. Excel displays a list of files it found, including details such as name, extension, and folder path.
- Review that list. If it includes unrelated files, select Transform Data so you can filter the file list before combining. If the list contains only the intended CSVs, select Combine & Transform Data.
- In the combine preview, choose or confirm the delimiter, file origin or encoding, and how Power Query identifies headers. Check that the sample columns appear in the right places, then confirm.
- Power Query Editor opens with the combined data and a set of supporting queries. Review the column names and data types, make any needed changes, and select Home > Close & Load to place the result in Excel.
The exact wording and order of dialog options can vary slightly between Excel builds. If the folder contains a non-CSV file, filter the file list by Extension before combining. For CSV files, the extension is commonly .csv. Filtering first is also helpful when the folder includes temporary files, archived exports, or different report types.
How the combine process works
When you combine files, Power Query uses a sample file to determine how to interpret the contents and creates transformation logic that can be applied to the other matching files. In the query pane, you may see a main combined query along with helper queries or functions, including one associated with the sample file. These are normal parts of the generated setup; they let Power Query repeat the same preparation steps for each file.
The sample file matters because its structure guides the transformation. If it has an extra title row or a different header arrangement from the others, the generated steps may not suit every file. A good approach is to make the files structurally consistent before combining, or to adjust the transformation steps in Power Query Editor and confirm that they work across the whole set.
Combining files is generally a row-wise operation, similar to appending tables. It is not the same as merging two tables by a matching key. If one CSV has customer details and another has order details and you want customer fields beside each order, that is a join or merge task. If each CSV contains more records of the same kind, combine them from the folder.
Transform data before loading
Power Query Editor lets you clean the data before it reaches the worksheet. For instance, a monthly sales export might include a report title above the header row, an extra Notes column, and an Amount column that Excel has interpreted as text. You can remove the title rows, promote the actual header row, remove unneeded columns, and set Amount to a numeric type. Those steps are then applied whenever the query refreshes.
Pay particular attention to data types. A value such as 03/04/2026 can mean different dates in different regional settings, and a decimal written as 12,50 may not be read like 12.50. In Power Query, use the column’s data-type menu and, when necessary, its locale options to make the interpretation explicit. Check a few known records against the source files before relying on calculations based on the result.
Headers should also be checked. If the first row in every CSV is already a header, ensure it is treated as a header rather than as a data record. If one file has different header names, Power Query may produce separate columns for those names instead of recognizing them as the same field. Renaming a column in the transformation can standardize a known variation, but a consistent export format is preferable.
Refreshes and ongoing maintenance
After loading, the combined result is a query output, not a live link that updates the moment a CSV changes. To retrieve new or changed source data, refresh the query with Data > Refresh All, or right-click the output table and choose Refresh. You can also open the query’s properties to review refresh-related settings. Refreshing reruns the saved steps against the files currently available at the source location.
New files that meet the folder query’s filters can be included on refresh. Files removed from the folder will generally no longer contribute rows after a successful refresh. A query can fail if the folder is moved, renamed, unavailable, or inaccessible to the person refreshing the workbook. If the source location changes, update the folder path in the query’s source step through Power Query’s settings or the query editor.
For a workbook used by other people, document the expected folder and file layout. Avoid renaming source columns casually, and test a new export before adding it to the live folder. If records repeat across files, Power Query will normally include them all; it does not automatically know that two identical rows are duplicates. Add a deliberate remove-duplicates step only if the business rules say those records should be removed.
Common problems and practical fixes
- Columns appear shifted or combined. Check the delimiter and text qualifiers in the combine preview. A comma-separated file may contain commas inside quoted text; interpreting it with the wrong delimiter can split values incorrectly.
- Some files are missing. Inspect the folder listing and any filters on Extension, Name, or Folder Path. Also verify that the files are in the folder being queried and that their extensions meet the filter criteria.
- Extra columns appear. Compare the headers across files. Differences such as Amount versus Sales, or a newly added field, can create separate columns. Standardize headers or deliberately transform the variations.
- Dates or amounts look wrong. The CSV does not preserve Excel’s cell formatting in the way a workbook does. Set the data type and locale in Power Query, then compare sample values with the original export.
- Rows are duplicated after refresh. Check whether a previous combined output or an archive was saved inside the input folder. Also remember that separate source files may themselves contain overlapping records.
- Refresh reports an access or path error. Confirm that the folder still exists, the drive is available, and the current user has permission. A workbook opened on another computer may not have access to a local path from the original computer.
A useful troubleshooting habit is to test with two small CSVs first: one ordinary file and one that represents a likely edge case, such as a missing optional column. This exposes assumptions in the transformation early. Once the query behaves as intended, add the remaining files and refresh.
Alternatives and platform differences
If the CSVs have very different layouts, a single folder-combine query may need substantial cleanup, or separate queries may be easier to maintain. You can import files individually with Data > Get Data > From File > From Text/CSV, transform them, and then append compatible queries in Power Query Editor. This takes more setup but gives more control when each source needs different preparation.
Excel for Mac has Power Query features, but its available connectors and interface can differ from Excel for Windows. If your Mac build does not offer the From Folder connector, import supported files individually and append them, or create and refresh the folder-based query in Excel for Windows. Excel for the web is also not a full substitute for Windows Power Query authoring; available editing and refresh capabilities depend on the workbook and service setup. For a recurring folder workflow, verify connector availability in the version you use before designing the process around it.
Frequently Asked Questions
Can Power Query combine CSV files with different column orders?
It can often combine data when columns have the same names but appear in different orders, because the query works with column names in the resulting table. However, inconsistent or missing headers can cause columns to be interpreted differently. Test files with variations and inspect the output rather than assuming the layouts are equivalent.
Do all CSV files need exactly the same columns?
No, but matching column names and types make the result more reliable. Where a file lacks a column present in other files, the combined table may contain blank values for that field in those rows. Different names for the same concept can appear as separate columns until you standardize them.
Will new CSV files be added automatically?
They can be included the next time you refresh, provided they are in the queried folder and pass its filters. They do not normally appear in the loaded table immediately when saved; refresh the query to rerun the import.
Can I combine files from subfolders?
The folder connector can list files from the selected folder structure, and its file list includes folder-path information. If you want only one specific folder level, filter Folder Path so files from unwanted subfolders are excluded. Check the listing before combining.
Does Power Query remove duplicate rows?
Not automatically just because files are combined. If duplicates are possible, decide what counts as a duplicate and add an appropriate remove-duplicates step, or handle them with a separate review process. Removing rows based only on all-column equality may not match rules based on a transaction ID.
Can I combine CSV files without copying them into one folder?
The folder connector is simplest when the files share a location. For files spread across locations, import them as separate queries and append them, or first organize copies in a dedicated source folder. Keep the original files unchanged if they are records that must be retained.
Related
- Excel Sum by Color: How to Total Cells by Fill Color
- Excel Sum by Cell Color: Methods That Actually Work
- Excel Max Cell Height: The 409-Point Row Height Limit
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Cell Adjustment Shortcut: Resize Rows and ColumnsIn Excel for Microsoft 365 on Windows, use Alt, H, O, I to AutoFit a column to its…
- Excel Row Freeze Shortcut and How to Use Freeze PanesIn Excel for Microsoft 365 on Windows, press Alt, then W, F, and R to freeze the top…
- Excel Mode With Text: Find the Most Frequent Text ValueExcel’s MODE.SNGL and MODE.MULT functions work with numbers, not words. To find the most frequent text value, count…
- Find Excel Spreadsheet Not Saved? Recovery Steps That WorkIf you closed an Excel workbook without saving, open Excel and select File > Info > Manage Workbook…
- Remove a Hard Page Break in Excel: Step-by-StepTo remove a hard (manual) page break in Excel for Microsoft 365 on Windows, select the cell below…
- Excel Shortcut to Insert a Row and Shift Cells DownIn Excel for Microsoft 365 on Windows, select the cell where the new space should begin and press…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.