Yes. In Excel for Microsoft 365 on Windows, import many CSV files at once by putting them in one folder, then choosing Data > Get Data > From File > From Folder and using Combine & Transform Data. Power Query can append the files into one table, and you can refresh the query later to include new files placed in that folder.
What happens when Excel combines CSV files
CSV files store rows of text separated by delimiters, commonly commas. Power Query reads each selected file, applies a set of transformation steps, and combines the results into a single query. In the usual case, the rows from each file are appended one after another; Excel is not placing every CSV on a separate worksheet.
This works especially well when the files represent the same kind of records over time. For example, if a sales system exports January.csv, February.csv, and March.csv with the columns Date, OrderID, Product, and Amount, Excel can combine their rows into one table for analysis. You can then create a PivotTable, filter the data, or load the result to a worksheet.
The files do not have to contain exactly the same number of records. They should, however, have compatible columns and formats. Power Query uses a sample file to determine how to interpret the files, so inconsistent headers or data types can require an extra cleanup step.
Prepare the folder before importing
Create a folder for the CSV files you want to combine. Put only the files for this dataset in it, or use a clearly named subfolder. The folder connector can consider files in the selected folder, so unrelated CSVs—such as an old export or a notes file saved as CSV—may be included unless you filter them out.
- Check that the files use the same delimiter, such as commas or semicolons.
- Keep the header names consistent, including spelling and spaces. Customer ID and CustomerID may be treated as different columns.
- Use a consistent date and number convention where possible. For example, avoid mixing dates written as month/day/year with dates written as day/month/year.
- Keep a backup of the original files. The query reads and transforms data; it does not need to alter the source CSVs.
- Close files that are being edited if they are saved in the folder, and avoid changing the folder contents while the query is refreshing.
Subfolders may be included depending on the folder connector and its settings. If you want only files at the selected folder level, inspect the file list in Power Query and filter the Folder Path column as needed.
Import and combine the files on Windows
- Open a blank workbook or the workbook where you want the combined results.
- Select Data > Get Data > From File > From Folder.
- Browse to the folder containing the CSV files and select it. Excel displays a list of files it finds.
- Review that list. If it includes unwanted files, choose Transform Data so you can filter the file list before combining.
- Choose Combine & Transform Data to inspect and adjust the import, or Combine & Load to load the combined result using the default steps.
- In the combine preview, confirm that the correct sample file, delimiter, and headers are being used. Select OK to create the combined query.
- In Power Query Editor, review the columns and data types. When the data is ready, select Home > Close & Load, or use the Close & Load options if you need to choose where the result goes.
The exact dialog wording can vary slightly by Excel build. If you want to remove blank rows, filter out a file, rename columns, or correct a type before loading, use Combine & Transform Data rather than loading immediately. The query keeps these transformation steps so they can be applied again on refresh.
Choose how the files should be combined
Appending is the standard choice when each file contains more records of the same kind. The combined table has one set of columns and a longer list of rows. This is appropriate for monthly sales exports, daily sensor readings, or customer lists split into batches.
Combining files is not the same as joining tables. A join matches rows using a shared key, such as OrderID, and brings columns from one table alongside another. If one CSV has orders and another has customer addresses, simply appending them will not match each order to its customer. Import them as separate queries and use a merge operation in Power Query when you need to match records by a common field.
If each file has different columns, Power Query can still produce a combined result, but the output may contain columns found in only some files, with blank values where a file did not supply that field. That does not guarantee the data is logically consistent. Decide whether the columns mean the same thing, standardize their names, and check the output before relying on it.
Control headers, file names, and data types
When Power Query combines files, it creates steps based on an example file and applies them to the others. A common source of trouble is a file with an extra title row, a different header row, or a note at the top. The query may interpret that text as data or promote the wrong row to column headings. Open the sample transformation in Power Query and make sure the first actual row of field names is being used.
Data types matter too. A product code such as 00127 is an identifier, not a number to calculate with. If Excel interprets it as a number, the leading zeros can disappear. Set identifier columns to Text in Power Query. Dates, decimal separators, and currency values also deserve a check, particularly when exports come from systems using different regional settings.
You can retain a file-name column to identify where each record came from. The folder query initially lists file names, and Power Query’s generated combine steps may expose a source-name field. Keep or add that field in the query if tracing a row back to a particular monthly export is important. The file name can also help diagnose a bad export.
Refresh the combined data
After the query is loaded, adding another matching CSV to the source folder does not necessarily update the worksheet immediately. Select Data > Refresh All to rerun the query, or right-click the output table and choose Refresh. Excel reads the folder again and reapplies the saved steps. If an existing file changes, a refresh can bring in its revised contents as well.
Refreshing is useful for repeat reporting: save the next export into the same folder, open the workbook, and refresh. It is still wise to check the refreshed row count and a few sample records. A renamed folder, moved source files, altered headers, or a new file with a different layout can break the expected process or produce unexpected results.
Power Query records a connection to the source location, so moving the workbook alone may not move the CSV folder with it. If the source path changes, edit the query’s source step in Power Query or recreate the connection to point at the new folder. For a shared workbook, plan a folder path that other users can access too.
Limits and common problems
An Excel worksheet can contain up to 1,048,576 rows, including the header row. If the combined query exceeds what fits on a sheet, loading the entire result to a worksheet is not suitable. Depending on the analysis, you may filter or summarize in Power Query before loading, or load to the Data Model instead; memory and workbook performance still matter.
- Only one file appears: Confirm that the other files are in the selected folder, have an accepted file type, and are not excluded by a filter.
- Columns are shifted or joined: The CSV may use a different delimiter or quoting convention. Check the delimiter and preview in the combine dialog or Power Query Editor.
- Headers show up as data: One or more files may have an extra introductory row or different headers. Correct the sample transformation and check the outlier file.
- Dates or decimals look wrong: Set the appropriate data type and, where needed, use the locale-aware type conversion options in Power Query.
- Leading zeros vanish: Change codes and IDs to Text rather than allowing automatic number detection.
- Refresh reports an error: Check whether the folder path still exists, whether a file was renamed or locked, and whether a new CSV has a different structure.
For a very large collection, consider filtering out irrelevant files before the combine step and removing unused columns early. This reduces unnecessary work and makes the final workbook easier to manage.
Excel for Mac and other options
Power Query is available in Microsoft 365 Excel for Mac, but the available connectors and interface can differ by Excel version and update channel. Look under Data > Get Data (Power Query) to see which sources your installation offers; the Windows From Folder workflow may not be available in every Mac build. If it is missing, a Windows desktop version of Excel can create the folder query, or you can import and append files using the tools available in your Mac version.
Excel for the web is useful for opening and editing many workbooks, but it does not provide the same full desktop workflow for creating a folder-based Power Query import. If a workbook already contains a query, refresh support can depend on the source and the account or environment. For repeat imports from a local folder, use desktop Excel.
For just two or three small files, opening each CSV and copying its rows into one workbook can be quicker than setting up a query. It is more manual, however, and easier to paste duplicate headers or miss rows. Power Query is generally a better fit when the task will recur or involve numerous files.
Frequently Asked Questions
Can Excel put each CSV file on a separate worksheet automatically?
From Folder with Combine is designed to append files into one query result, not create a worksheet per file. To keep separate sheets, import the files individually or use a workflow specifically designed to create separate sheets.
Do all CSV files need identical columns?
They should have compatible fields for a clean append. Differing columns may appear in the output with blanks for files that lack a field, but different meanings, header spelling, or layouts should be standardized and checked.
Will new CSV files be added automatically?
They can be included when you refresh the query, provided they are in the source folder and match the query’s filters and expected structure. Excel does not necessarily update the table the moment a file is saved.
Can I combine CSV files with different names?
Yes. File names do not have to match. The important factors are the folder location, any filters applied to the file list, and whether the files can be interpreted consistently.
Can I combine CSV files with different delimiters?
It is possible to transform files with different layouts, but the default combine process assumes a consistent structure. Standardize the delimiter first if practical, or create and verify transformations that handle the differences.
For recurring imports of similarly structured files, the folder connector and Power Query provide a repeatable alternative to opening and pasting each CSV by hand. Take time to inspect headers, types, and outlier files before loading; a successful combine is only useful if the resulting columns and values mean what you expect.
Related
- Excel Text to Columns: Choosing a Number Delimiter
- Excel Text to Columns Shortcut: Windows and Mac
- Excel Text to Columns: Split Cells at Line Breaks Easily
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Delete Blank Rows in an Excel Table SafelyTo delete blank rows in an Excel table, first identify rows that are genuinely empty, then remove the…
- Inventory Spreadsheet Template for Google Sheets: GuideYes. You can make an inventory spreadsheet template in Google Sheets by creating columns for each item’s identifier,…
- How to Set Out of Office in Outlook on Any DeviceTo set yourself out of office in Outlook, open Automatic Replies for the account you will be away…
- Schedule Repeat Emails in Outlook: Options and StepsOutlook can schedule an individual email to send later, but it does not have a built-in option to…
- How to Format a Box and Whisker Plot in Microsoft ExcelTo format a box and whisker plot in Excel, select the chart, right-click a box, and choose Format…
- Excel Shortcut Keys: Examples for Everyday TasksExcel shortcut keys let you edit, format, calculate, and move around a workbook without repeatedly reaching for the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.