Merge Excel Files
Append rows into one worksheet or keep each file as a separate worksheet
Merge Excel Files — what it does
Combine several Excel files two ways: append all their rows into one worksheet, or keep each file as its own worksheet in a single workbook. An optional source filename column records which file each row came from, which is the difference between merged data and merged data you can still trace.
Worked example
Two regional order files (east-orders.xlsx and west-orders.xlsx, one sheet each) appended into one worksheet with 'add source filename column' ticked.
Input — east-orders.xlsx › Orders and west-orders.xlsx › Orders
east-orders.xlsx order_id | product | qty | amount 1001 | Notebook | 12 | 42 1003 | Notebook | 5 | 17.5 1006 | Stapler | 1 | 8.99 west-orders.xlsx order_id | product | qty | amount 1002 | Stapler | 3 | 26.97 1005 | Notebook | 7 | 24.5 1008 | Desk lamp | 2 | 48
Output — merged-excel-files.xlsx › Merged
order_id | product | qty | amount | Source File 1001 | Notebook | 12 | 42 | east-orders.xlsx 1003 | Notebook | 5 | 17.5 | east-orders.xlsx 1006 | Stapler | 1 | 8.99 | east-orders.xlsx 1002 | Stapler | 3 | 26.97 | west-orders.xlsx 1005 | Notebook | 7 | 24.5 | west-orders.xlsx 1008 | Desk lamp | 2 | 48 | west-orders.xlsx
The header comes from the first file; files are processed in the order they were selected. In 'Keep separate worksheets' mode the same input gives two sheets named east-orders-Orders and west-orders-Orders, each with the source column.
When this tool helps
- Consolidating monthly or per-branch workbooks into one file for analysis.
- Gathering submissions from several people into a single workbook with one tab each.
- Building a combined dataset from exports that share the same column layout.
How to use it
- Choose the Excel files to merge.
- Pick a mode: append rows, or keep separate worksheets.
- Turn on the source filename column if you need provenance.
- Process and download the merged workbook.
Accuracy, limits, and good practice
- Appending assumes matching headers; a file with different column names produces gaps rather than an error, so check the result.
- Separate-worksheet mode is safer when the files differ structurally — nothing is forced into a shared shape.
- Keep the source column when appending. Once rows are stacked there is no other way to tell where any of them came from.
Frequently asked questions
What if the files have different columns?
Append mode aligns on headers and leaves blanks where a file lacked a column. Align them first with the column reorder tool for a clean merge.
Which worksheet is taken from each file?
Check the output after merging — if a file has several sheets, verify the one you expected was used.
Is there a limit on file count?
Practically it is memory. A dozen ordinary workbooks is routine; very large files should be merged in smaller groups.
How are the worksheets named in separate mode?
<file name without extension>-<sheet name>, so east-orders-Orders and west-orders-Orders here; the characters \ / ? * [ ] : are replaced by spaces, names are cut to 31 characters and a clash gets a numeric suffix. In append mode the single sheet is called Merged.
Where does the source column go?
Last, headed Source File, holding the full file name (east-orders.xlsx) on every data row; in separate mode it is added to each sheet too. The download is always merged-excel-files.xlsx.
Related tools on this site
- Excel Formulas to Values — Replace formulas with their current calculated values throughout an Excel workbook
- Excel to HTML Table — Convert a selected Excel worksheet into a responsive HTML table and downloadable webpage
- JSON to Excel — Turn JSON arrays into an XLSX worksheet with optional flattening
Further reading: Cleaning a CSV export before you import it anywhere · CSV, JSON, YAML, XML and Markdown Tables: When Each Fits and How to Convert
Everything above runs inside this page. Merge Excel Files needs no account, no upload, and no server round trip — close the tab and nothing is left behind.
合併多個 Excel 檔案能做什麼
以兩種方式合併多個 Excel 檔案:把所有資料列附加到同一個工作表,或讓每個檔案各成一個工作表放進同一份活頁簿。可選的來源檔名欄會記錄每列出自哪個檔案,這正是「合併過的資料」與「合併後仍可追溯的資料」之間的差別。
實際範例
兩個地區的訂單檔(east-orders.xlsx 與 west-orders.xlsx,各一張工作表),勾選「加上來源檔名欄」後接續成同一張工作表。
來源:east-orders.xlsx › Orders 與 west-orders.xlsx › Orders
east-orders.xlsx order_id | product | qty | amount 1001 | Notebook | 12 | 42 1003 | Notebook | 5 | 17.5 1006 | Stapler | 1 | 8.99 west-orders.xlsx order_id | product | qty | amount 1002 | Stapler | 3 | 26.97 1005 | Notebook | 7 | 24.5 1008 | Desk lamp | 2 | 48
產生的檔案:merged-excel-files.xlsx › Merged
order_id | product | qty | amount | Source File 1001 | Notebook | 12 | 42 | east-orders.xlsx 1003 | Notebook | 5 | 17.5 | east-orders.xlsx 1006 | Stapler | 1 | 8.99 | east-orders.xlsx 1002 | Stapler | 3 | 26.97 | west-orders.xlsx 1005 | Notebook | 7 | 24.5 | west-orders.xlsx 1008 | Desk lamp | 2 | 48 | west-orders.xlsx
標題列取自第一個檔案;檔案依選取順序依序接上。改成「Keep separate worksheets」模式,同樣的來源會得到 east-orders-Orders 與 west-orders-Orders 兩張工作表,各自帶來源欄。
什麼時候用得上
- 把各月份或各分店的活頁簿整併成一份檔案以供分析。
- 把多人繳交的檔案收成一份活頁簿,每人一個分頁。
- 從欄位結構相同的匯出檔建立合併資料集。
使用步驟
- 選擇要合併的 Excel 檔案。
- 選擇模式:附加資料列,或保留為獨立工作表。
- 如需追溯來源,開啟來源檔名欄位。
- 執行處理並下載合併後的活頁簿。
精確度、限制與實務建議
- 附加模式假設標題一致;欄名不同的檔案會產生空格而不是報錯,請檢查結果。
- 檔案結構不一致時,獨立工作表模式更安全——不會硬把資料塞進同一種形狀。
- 附加時請保留來源欄。資料一旦疊在一起,就再也沒有別的方式知道每列從哪來。
常見問題
檔案欄位不同怎麼辦?
附加模式會依標題對齊,缺欄處留白。想要乾淨合併,請先用欄位重新排序工具對齊。
會取每個檔案的哪個工作表?
合併後請檢查輸出——若檔案有多個工作表,確認採用的是你預期的那個。
檔案數量有上限嗎?
實際上限在記憶體。十來個一般活頁簿沒問題,超大檔案建議分小批合併。
分開工作表模式下,工作表怎麼命名?
「檔名去掉副檔名-工作表名」,這裡是 east-orders-Orders 與 west-orders-Orders;\ / ? * [ ] : 這些字元會換成空白,名稱截到 31 字,撞名時加數字後綴。接續模式下唯一的工作表叫 Merged。
來源欄放在哪裡?
放最後一欄,標題為 Source File,每列資料填完整檔名(east-orders.xlsx);分開工作表模式下每張表也都會加上。下載檔一律叫 merged-excel-files.xlsx。
本站相關工具
- Excel 公式轉數值 — 將 Excel 活頁簿中的公式替換為目前計算結果
- Excel 轉 HTML 表格 — 將指定 Excel 工作表轉為響應式 HTML 表格與可下載網頁
- JSON 轉 Excel — 將 JSON 陣列轉為 XLSX,並可攤平巢狀資料
延伸閱讀: 匯入之前先把 CSV 匯出檔清乾淨 · CSV、JSON、YAML、XML 與 Markdown 表格:各自適用的場合與轉換方法
以上步驟全部在這個頁面內完成,合併多個 Excel 檔案 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。