Merge two excel files

Bookmark this app

Press Ctrl + D to add this page to your favorites or Esc to cancel the action.

Send the download link to

Send us your feedback

Oops! An error has occurred.

Invalid file, please ensure that uploading correct file

Error has been reported successfully.


You have successfully reported the error, You will get the notification email when error is fixed.

Click this link to visit the forums.

Immediately delete the uploaded & processed files.

Are you sure to delete the files?

Enter Url

Accessing data from multiple Excel files can be time-consuming and hard.

You often have to switch between multiple open windows, it’s messy and you feel like there’s data all over the place.

So, when you have to access data that is spread out over multiple Excel files, it makes sense to merge the sheets from all these files into one single Excel workbook.

This keeps your data organized and saves a lot of referencing time.

In this tutorial, we show you three ways to merge two Excel files:

  • Using the Move or Copy feature
  • Using VBA
  • Using Get & Transform tools

Imagine you have two separate files:

  • File1
  • File2

These two files contain order-related information (for an imaginary company).

File1 has 2 tabs (named Apr-Jun 2021 and Jul-Sep 2021) and File2 has a single tab (named Jan-Mar 2021).

File 1 with 2 sheets
File 2 with 1 sheet

Let’s say you want to merge File1 and File2 by bringing both sheets of File1 into File2.

As mentioned before, there are 3 ways to do this. The method you choose will depend on your requirement and how your data is structured.

Let us look at each method one by one.

Using the Move or Copy Feature to Merge Two Excel Files

This is the simplest and the most commonly used method to merge two Excel Files.

This method is suited in situations where you have to merge two or more Excel files that have only a few sheets, and you need to do it only once in a while.

Below are the merge two Excel files manually:

  1. Select all the tabs that you want to move or copy from File1. Since we want to move all the sheets from File1, we simply select the first tab, hold down the shift key and select the last tab.
  2. Right-click on your selected tabs and click on ‘Move or Copy’ from the context menu that appears.
Click on Move or Copy
  1. This opens the ‘Move or Copy’ dialog box.
Move or Copy dialog box
  1. Click on the dropdown under ‘To book:’.
  2. From here, you can select the file (or workbook) to which you want to move or copy the selected sheet(s). Since we want to transfer the sheet to File2, we can select the File2.xlsx option from this list.
Select the file to which to move the sheets
  1. You should now see the different move or copy options available in the list under ‘Before Sheet:’. Select where in File2 you want the sheet moved. Since Apr-Jun 2021 comes after Jan-Feb 2021, it makes sense to place it at the end (as the last sheet of File2). So select (move to end)
Select move to end option
  1. If you want to retain a copy of the sheets in File1, then check the box next to ‘Create a copy’.
Check the Create a Copy option
  1. Click OK.

All sheets of File1 should now get copied to File2, so that it now contains 3 sheets in all.

Excel files have been merged

Note that for this method to work, you need to have both the files open (one from which you want to copy the sheets and the one where you want to copy these sheets).

Also, note that this method will create a copy of sheets in File1 and add these to File2. These sheets will still remain in File1.

As I mentioned, this method is fine if you want to do this once in a while with files that have less number of sheets. If you have more sheets, there is always a chance of human error. In such cases, you can use the VBA or the Power Query method covered next.

In case you have more than two Excel files that you want to merge, you can follow the same process, where you combine two Excel files, and then combine the third/fourth file with it.

Using VBA to Merge Two Excel Files

The second method to merge two Excel files uses the following VBA script:

'Code by Steve Scott from https://spreadsheetplanet.com
Sub MergeSheets()
Dim SourceWb As Workbook
Dim TargetWb As Workbook
Set SourceWb = Workbooks("File1")
Set TargetWb = Workbooks("File2")
Dim SourceSheet As Worksheet
For Each SourceSheet In SourceWb.Sheets
SourceSheet.Copy After:=TargetWb.Sheets(TargetWb.Sheets.Count)
Next
End Sub

The above script simply takes two files, “File1” and “File2“, cycles through each sheet of File1 and appends a copy of it to File2.

All you need to do is replace the filenames “File1” and “File2” in the above code with your required source and target files.

For this code to work, your Excel files need to be open. In case you want the code to open a closed file, copy sheets from one file to another, and then close the files again, you can do that too (you will need to modify the code to do that).

Note: This script copies the “File1” sheets and pastes them into “File2”. This means the original sheets within “File1” remain as they were.

To run the above script, follow the steps below:

  1. Make sure both files that you want to merge are open.
  2. Navigate to Developer->Visual Basic.
Click on Visual Basic
  1. When the Visual Basic window opens, click Insert->Module.
Insert a module in the VB Editor
  1. Copy and paste the above code into the newly opened window.
Copy and Paste the code in the module
  1. Edit the code according to your requirement. For example, change the filenames in lines 4 and 5, or make other changes if you need to.
  2. Run the code by clicking on the Run button, as shown below:
Run theVBA code

That’s it!

You should now find the sheets of File1 and File2 merged into File2, while retaining a copy of the original sheets in File1 too.

Excel files have been merged

Note: If you cannot find the Developer menu option, navigate to File->Options->Customize Ribbon and check the Developer option. Click OK.

Using Get & Transform Tools (Power Query) to Merge Two Excel Files

If you’re using Excel 2016 or newer versions, you can also use the Get & Transform tool to merge two or more Excel files.

The Get & Transform tool is a Power Query feature that allows you to import data from multiple sources quickly and easily.

The great thing is that you can use it to make changes to your source data as required before importing it to the new workbook.

Here are the steps that you need to follow in order to merge two Excel Files using the Get & Transform tool:

  1. Open File2
  2. From the Data tab, select New Query (from the Get & Transform group).
Click on New Query
  1. Select From File -> From Workbook from the dropdown list that appears.
Select from Workbook
  1. This opens the Import Data window, from where you can select the workbook from which you want to import the sheets. Select File1 and click Import.
Select the Excel file you want to merge
  1. This opens the Navigator window, where you can see a list of all the sheets and tables from File1.
Power Query Navigator window
  1. Since we want to import more than one sheet, check the box next to ‘Select multiple items’.
Check select multiple items
  1. Check the boxes next to the sheets you want to import. In our case, we select both.
Select all the sheets you want to merge
  1. Click on the dropdown arrow next to ‘Load’ at the bottom of the window.
  2. Select ‘Load to’.
Click on Load to
  1. From the Load To window, check the radio button next to ‘Table’ and click ‘Load’.
Load as a table in the worksheet
  1. Wait for the query to complete processing.

You should now see two new sheets in File2

New sheets are inserted

Notice that the names of the sheets are just the generic Sheet1 and Sheet2, so you’ll have to double click on each tab and change the sheet names (if you need to).

That’s it! You have now merged File1 into File2, which now contains all 3 sheets!

Also, notice that the data in the newly imported sheets are in the form of an Excel table. If you don’t want that, you could simply convert them back to ranges by navigating to Table Design->Convert to Range.

Convert to Range option in Table Design

When you are asked to confirm, simply click OK.

Click Ok

In this tutorial, we showed you 3 ways to merge two files in Excel.

The first two methods (using Move or Copy and using VBA) are more commonly used since they have been around for a while.

The last method (using Get & Transform) is the lesser-used method since it is fairly new and only available in newer Excel versions.

However, Power Query is increasingly becoming the go-to tool for businesses and other industries, so it makes sense to learn how to bring together data from multiple sources into the framework, to facilitate further processing.

Other articles you may also like:

  • How to Convert a CSV File to Excel?
  • How to Convert a Text File to Excel?
  • How to Make Excel File Read Only
  • How to Insert an Excel file into MS Word
  • How to Unmerge All Cells in Excel?
  • How to Copy Multiple Sheets to a New Workbook in Excel
  • How to Group and Ungroup Worksheets in Excel
  • How to Open Excel File [xls, xlsx] Online (for FREE)
  • Microsoft Excel vs Google Sheets – Which One Is Better for You?
  • Switch Between Excel Workbooks (Shortcut)
  • How to Combine Two Columns in Excel (with Space/Comma)

Skip to content

Как быстро объединить несколько файлов Excel

Мы рассмотрим три способа объединения файлов Excel в один: путем копирования листов, запуска макроса VBA и использования инструмента «Копировать рабочие листы» из надстройки Ultimate Suite.

Намного проще обрабатывать данные в одном файле, чем переключаться между многочисленными книгами. Однако объединение нескольких книг Excel в один файл может быть сложным и долгим процессом, особенно если книги, которые вам нужно объединить, содержат много листов. Итак, как подойти к этой проблеме? Вы будете копировать их вручную или с помощью кода VBA? Или вы используете один из специализированных инструментов для объединения файлов Excel? 

Ниже вы найдете несколько хороших способов, позволяющих реализовать объединение.

  • Самое простое — копировать вручную.
  • Объединение файлов Excel при помощи VBA.
  • Как объединить несколько файлов с помощью Ultimate Suite.

Примечание. В этой статье мы рассмотрим, как копировать листы из нескольких книг Excel в одну книгу. Если вы ищете быстрый способ скопировать данные с нескольких листов на один общий лист, вы найдете подробную инструкцию в другой статье: Как объединить несколько листов в один.

Простой метод — копировать листы руками.

Если вам нужно объединить всего пару файлов Excel, вы можете вручную скопировать или переместить листы из одного файла в другой. Вот как это можно сделать:

  1. Откройте книги, которые мы планируем объединить.
  2. Выберите листы в исходной книге, которые вы хотите скопировать в основную книгу.

Чтобы выбрать несколько листов, используйте один из следующих приемов:

  • Чтобы выбрать соседние листы, щелкните вкладку первого, который вы хотите скопировать, нажмите и удерживайте клавишу Shift, а затем щелкните вкладку последнего. Это действие выберет все листы между ними.
  • Чтобы выбрать несмежные, удерживайте клавишу Ctrl и щелкайте вкладку каждого из них по отдельности.
  • Выделив все нужные листы, щелкните правой кнопкой мыши любую из выделенных вкладок и выберите «Переместить» или «Копировать…» .

  1. В диалоговом окне «Перемещение или копирование» выполните следующие действия:
    • В раскрывающемся списке «Переместить выбранные листы в книгу» выберите целевую книгу, в которую вы хотите объединить другие файлы.
    • Укажите, где именно должны быть вставлены вкладки. В нашем случае мы выбираем вариант вставки в конец списка.
    • Установите флажок «Создать копию», если хотите, чтобы исходные данные оставались оригинальном файле.
    • Нажмите ОК, чтобы завершить операцию.

Чтобы объединить вкладки из нескольких файлов Excel, повторите описанные выше шаги для каждой книги отдельно.

Замечание. При копировании листов вручную помните о следующем ограничении, налагаемом Excel: невозможно переместить или скопировать группу листов, если какой-либо из них содержит «умную» таблицу. В этом случае вам придется либо преобразовать таблицу в диапазон, либо использовать один из других методов, не имеющих этого ограничения.

Как объединить файлы Excel с VBA

Если у вас есть несколько файлов Excel, которые необходимо объединить в один файл, более быстрым способом будет автоматизировать процесс с помощью макроса VBA.

Ниже вы найдете код VBA, который копирует все листы из всех файлов Excel, которые вы выбираете, в одну книгу. Этот макрос MergeExcelFiles написан Алексом.

Важное замечание! Макрос работает со следующим ограничением — объединяемые файлы не должны быть открыты физически или находиться в памяти, в буфере обмена. В таком случае вы получите ошибку во время выполнения.

Sub MergeExcelFiles()
    Dim fnameList, fnameCurFile As Variant
    Dim countFiles, countSheets As Integer
    Dim wksCurSheet As Worksheet
    Dim wbkCurBook, wbkSrcBook As Workbook
 
    fnameList = Application.GetOpenFilename(FileFilter:="Microsoft Excel Workbooks (*.xls;*.xlsx;*.xlsm),*.xls;*.xlsx;*.xlsm", Title:="Choose Excel files to merge", MultiSelect:=True)
 
    If (vbBoolean <> VarType(fnameList)) Then
 
        If (UBound(fnameList) > 0) Then
            countFiles = 0
            countSheets = 0
 
            Application.ScreenUpdating = False
            Application.Calculation = xlCalculationManual
 
            Set wbkCurBook = ActiveWorkbook
 
            For Each fnameCurFile In fnameList
                countFiles = countFiles + 1
 
                Set wbkSrcBook = Workbooks.Open(Filename:=fnameCurFile)
 
                For Each wksCurSheet In wbkSrcBook.Sheets
                    countSheets = countSheets + 1
                    wksCurSheet.Copy after:=wbkCurBook.Sheets(wbkCurBook.Sheets.Count)
                Next
 
                wbkSrcBook.Close SaveChanges:=False
 
            Next
 
            Application.ScreenUpdating = True
            Application.Calculation = xlCalculationAutomatic
 
            MsgBox "Processed " & countFiles & " files" & vbCrLf & "Merged " & countSheets & " worksheets", Title:="Merge Excel files"
        End If
 
    Else
        MsgBox "No files selected", Title:="Merge Excel files"
    End If
End Sub

Как добавить этот макрос в книгу

Если вы хотите вставить макрос в свою книгу, выполните следующие обычные действия:

  1. нажимать Alt + F11 , чтобы открыть редактор Visual Basic.
  2. Щелкните правой кнопкой мыши ThisWorkbook на левой панели и выберите « Вставить» > « Модуль» в контекстном меню.
  3. В появившемся окне (Окно кода) вставьте указанный выше код.

Более подробная инструкция описана в разделе Как вставить и запустить код VBA в Excel .

Кроме того, вы можете загрузить макрос в файле Excel, открыть его в этой книге (включить выполнение макросов, если будет предложено), а затем переключиться на свою собственную книгу и нажать Alt + F8 для его запуска. Если вы новичок в использовании макросов в Excel, следуйте подробным инструкциям ниже.

Как использовать макрос MergeExcelFiles

Откройте файл Excel, в котором вы хотите объединить листы из других книг, и выполните следующие действия:

  1. Нажмите комбинацию Alt + F8, чтобы открыть окно диалога.
  2. В разделе « Имя макроса» выберите MergeExcelFiles и нажмите «Выполнить».

  1. Откроется стандартное окно проводника, вы выберите одну или несколько книг, которые хотите объединить, и нажмите «Открыть» . Чтобы выбрать несколько файлов , удерживайте нажатой клавишу Ctrl, указывая на их имена.

В зависимости от того, сколько файлов вы выбрали, дайте макросу несколько секунд или минут для их обработки. После завершения всех операций он сообщит вам, сколько файлов было обработано и сколько листов было объединено:

Как объединить несколько файлов с помощью Ultimate Suite.

Если вам не очень комфортно с VBA и вы ищете более простой и быстрый способ объединить файлы Excel, обратите внимание на инструмент «Копирование листов (Copy Sheets)» — одну из более чем 60 функций, включенных в невероятно функциональную программу Ultimate Suite for Excel. Она работает в версиях Excel 2010-2019.

С Ultimate Suite объединение нескольких файлов Эксель в один так же просто, как раз-два-три (буквально, всего 3 быстрых шага). Вам даже не нужно открывать те из них, которые вы хотите объединить. И это могут быть два файла или несколько — не важно.

  1. Открыв главную книгу, перейдите на вкладку «Ablebits Data» и нажмите «Копировать листы (Copy Sheets)» > «Выбранные в одну книгу (Selected Sheets to one workbook)».

  1. В диалоговом окне выберите файлы (а в них — листы), которые вы хотите объединить, и нажмите «Далее (Next)» .

Советы:

  • Чтобы выбрать все листы в определенной книге, просто поставьте галочку в поле рядом с именем книги, и все они в этом файле будут выбраны автоматически.
  • Чтобы объединить листы из закрытых книг, нажмите кнопку «Добавить файлы…» и выберите столько книг, сколько нужно. Это добавит выбранные файлы только в окно копирования, не открывая их в Excel.
  • По умолчанию копируются все данные. Однако, в разных листах можно выбрать разные диапазоны для объединения. Чтобы скопировать только определенную область, наведите указатель мыши на имя вкладки, затем щелкните значок    и выберите нужный диапазон. 
  • При необходимости укажите один или несколько дополнительных параметров и нажмите «Копировать» . На снимке скриншоте а ниже показаны настройки по умолчанию: Вставить все (формулы и значения) и Сохранить форматирование.

Дайте мастеру копирования листов несколько секунд для обработки и наслаждайтесь результатом!

На этой странице есть подробное описание всех возможностей работы мастера копирования.

Чтобы поближе познакомиться с этим и другими инструментами для Excel, вы можете загрузить ознакомительную версию Ultimate Suite.

Итак, я надеюсь, вы получили ответ на вопрос — как быстро объединить несколько файлов Excel в один.

You have several Excel workbooks and you want to merge them into one file? This could be a troublesome and long process. But there are 6 different methods of how to merge existing workbooks and worksheets into one file. Depending on the size and number of workbooks, at least one of these methods should be helpful for you. Let’s take a look at them.

Summary

If you want to merge just a small amount of files, go with methods 1 or method 2 below. For anything else, please take a look at the methods 4 to 6: Either use a VBA macro, conveniently use an Excel-add-in or use PowerQuery (PowerQuery only possible if the sheets to merge have exactly the same structure).

Method 1: Copy the cell ranges

copy, paste, source, main, merge, join
Copy and paste the source content into your main workbook.

The obvious method: Select the source cell range, copy and paste them into your main workbook. The disadvantage: This method is very troublesome if you have to deal with several worksheets or cell ranges. On the other hand: For just a few ranges it’s probably the fastest way.

Method 2: Manually copy worksheets

copy, move, worksheet, sheet, excel
Copy worksheets separately to the “master” workbook.

The next method is to copy or move one or several Excel sheets manually to another file. Therefore, open both Excel workbooks: The file containing the worksheets which you want to merge (the source workbook) and the new one, which should comprise all the worksheets from the separate files.

  1. Select the worksheets in your source workbooks which you want to copy. If there are several sheets within one file, hold the Ctrl key computer_key_Ctrland click on each sheet tab. Alternatively, go to the first worksheet you want to copy, hold the Shift key computer_key_Shift and click on the last worksheet. That way, all worksheets in between will be selected as well.
  2. Once all worksheets are selected, right click on any of the selected worksheets.
  3. Click on “Move or Copy”.
  4. Select the target workbook.
  5. Set the tick at “Create a copy”. That way, the original worksheets remain in the original workbook and a copy will be created.
  6. Confirm with OK.

One small tip at this point: You can just drag and drop worksheets from one to another Excel file. Even better: If you press and hold the Ctrl-Key when you drag and drop the worksheets, you create copies.


Do you want to boost your productivity in Excel?

Get the Professor Excel ribbon!

Add more than 120 great features to Excel!


Method 3: Use the INDIRECT formula

The next method comes with some disadvantages and is a little bit more complicated. It works, if your files are in a systematic file order and just want to import some certain values. You build your file and cell reference with the INDIRECT formula. That way, the original files remain and the INDIRECT formula only looks up the values within these files. If you delete the files, you’ll receive #REF! errors.

indirect, link, other, file, excel
With the INDIRECT formula you can link to other files. Only condition: the source file must be open in the background.

Let’s take a closer look at how to build the formula. The INDIRECT formula has only one argument: The link to another cell which can also be located within another workbook.

  1. Copy the first source cell.
  2. Paste it into your main file using paste special (Ctrl computer_key_Ctrl+ Alt computer_key_Alt+ v computer_key_V). Instead of pasting it normally, click on “Link” in the bottom left corner of the Paste Special window. That way, you extract the complete path. In our case, we have the following link:
    =[160615_Examples.xlsm]Thousands!$C$4
  3. Now we wrap the INDIRECT formula around this path. Furthermore, we separate it into file name, sheet name and cell reference. That way, we can later on just change one of these references, for instance for different versions of the same file. The complete formula looks like this (please also see the image above):
    =INDIRECT(“‘”&$A3&$B3&”‘!”&D$2&$C3)

Important – please note: This function only works if the source workbooks are open.

Method 4: Merge files with a simple VBA macro

You are not afraid of using a simple VBA macro? Then let’s insert a new VBA module:

  1. Go to the Developer ribbon. If you can’t see the Developer ribbon, right click on any ribbon and then click on “Customize the Ribbon…”. On the right hand side, set the tick at “Developer”.
  2. Click on Visual Basic on the left side of the Developer ribbon.
  3. Right click on your workbook name and click on Insert –> Module.
  4. Copy and paste the following code into the new VBA module. Position the cursor within the code and click start (the green triangle) on the top. That’s it!
Sub mergeFiles()
    'Merges all files in a folder to a main file.
    
    'Define variables:
    Dim numberOfFilesChosen, i As Integer
    Dim tempFileDialog As fileDialog
    Dim mainWorkbook, sourceWorkbook As Workbook
    Dim tempWorkSheet As Worksheet
    
    Set mainWorkbook = Application.ActiveWorkbook
    Set tempFileDialog = Application.fileDialog(msoFileDialogFilePicker)
    
    'Allow the user to select multiple workbooks
    tempFileDialog.AllowMultiSelect = True
    
    numberOfFilesChosen = tempFileDialog.Show
    
    'Loop through all selected workbooks
    For i = 1 To tempFileDialog.SelectedItems.Count
        
        'Open each workbook
        Workbooks.Open tempFileDialog.SelectedItems(i)
        
        Set sourceWorkbook = ActiveWorkbook
        
        'Copy each worksheet to the end of the main workbook
        For Each tempWorkSheet In sourceWorkbook.Worksheets
            tempWorkSheet.Copy after:=mainWorkbook.Sheets(mainWorkbook.Worksheets.Count)
        Next tempWorkSheet
        
        'Close the source workbook
        sourceWorkbook.Close
    Next i
    
End Sub

Method 5: Automatically merge workbooks

The fifth way is probably most convenient:

Click on “Merge Files” on the Professor Excel ribbon.

Now select all the files and worksheets you want to merge and start with “OK”.

This procedure works well also for many files at the same time and is self-explanatory. Even better: Besides XLSX files, you can also combine XLS, XLSB, XLSM, CSV, TXT and ODS files.

To do that you need a third party add-in, for example our popular “Professor Excel Tools” (click here to start the download).

Here is the whole process in detail:

Just click on "Merge Files" on the Professor Excel ribbon, select your files and click on OK.

Just click on “Merge Files” on the Professor Excel ribbon, select your files and click on OK.

Method 6: Use the Get & Transform tools (PowerQuery)

merge, workbooks, get, transform, complete, folder
merge, workbooks, get, transform, complete, folder
merge, workbooks, get, transform, complete, folder

The current version of Excel 365 offers the “Get & Transform” tools to import data. These functions are very powerful and are supposed to replace the old “Text Import Wizard”. However, they have one useful feature: Import a complete folder of documents.

The requirements: The workbooks and worksheets you want to import have to be in the same format.

Please follow these steps for importing a complete folder of Excel files.

  1. Create a folder with all the documents you want to import.
  2. Usually it’s the fastest to just copy the folder path directly from the Windows Explorer. You still have the change to later-on select the folder, though.
  3. Within Excel, go to the Data ribbon and click on “Get Data”, “From File” and then on “From Folder”.
  4. Paste the previously copied path or select it via the “Browse” function. Continue with “OK”.
  5. If all files are shown in the following window, either click on “Combine” (and then on “Combine & Load To”) or on “Edit”. If you click on “Edit”, you can still filter the list and only import a selection of the files in the list. Recommendation: Put only the necessary files into your import folder from the beginning so that you don’t have to navigate through the complex “Edit” process.
  6. Next, Excel shows an example of the data based on the first file. If everything seems fine, click on OK. If your files have several sheets, just select the one you want to import, in this example “Sheet1”. Click on “OK”.
  7. That’s it, Excel now imports the data and inserts a new column containing the file name.

For more information about the Get & Transform tools please refer to this article.

Next step: Merge multiple worksheets to one combined sheet

After you have combined many Excel workbooks into one file, usually the next step is this: Merge all the imported sheets into one worksheet.

Because this is a whole different topic by itself, please refer to this article.

Image by MartinHolzer from Pixabay

Which option would you choose: have three Excel files with one worksheet each or one Excel file with three worksheets? The former is not practical and convenient from the user’s perspective. Whereas, the latter allows you to easily navigate and manipulate your records in one place. So, let’s organize your data in an efficient way by merging Excel files into one. This tutorial will help you combine multiple Excel files into one according to your needs.

How to merge Excel files – all options introduced

Most of us love Excel for its functional diversity. This means that you can do a certain action or task in multiple ways depending on your needs. For example, you can merge Excel files in the following ways:

  • Manually copy data from multiple workbooks, then paste it into one worksheet.
  • Manually copy worksheets from multiple files to a single workbook.
  • Link or export data from multiple worksheets in a single workbook.
  • Merge multiple Excel files using Power Query.
  • Merge Excel files into a single workbook using VBA macros.

If you already know which case is yours, jump right into the required section. However, we advise you read the entire guide to learn the details of merging Excel files.

How to merge two Excel files the easy way

Here we have two Excel files with one worksheet each. 

1.1 two excel files

The simplest way to merge two Excel files is to copy a data range from one of them and paste it into another one:

  • On one of the files, select a data range, then right-click and select Copy.

1.2 copy dataset excel

  • Go to the other file, select a cell where you want to paste the data, then right-click and select Paste.

1.3 paste dataset excel

In our case, we forgot to exclude the first row with column names when we copied the data range and got the following result:

1.4 merge two excel files manually

So if you use this method to merge Excel files, make sure to select the proper data range.

Obviously, this method is plain enough. However, it won’t be suitable if your Excel files contain hundreds or thousands of rows you want to merge. Let’s proceed to other options then.

How to combine multiple Excel files into one by copying their sheets

We have three Excel files with one worksheet each. We want to combine multiple excel files into one workbook but keep these separate sheets in one Excel file. So, we just need to copy these sheets.

  • Open all the files.

2.1 open three excel files

  • Right-click on the sheet you want to copy and select Move or Copy…
2.2 move or copy excel sheet
  • Select the file where you want to copy your sheet to, and check the Create a copy checkbox.
2.3 move or copy excel sheet
  • Repeat this process for the rest of the sheets, and there you go:
2.4 sheets copied to one excel file

Now you have all the sheets from separate Excel files merged in one Excel workbook.

Merge Excel files online

If you work in Excel Online and you need to merge your files located in cloud storage such as OneDrive, you can:

  • Manually copy and paste data.
  • Link Excel sheets using Workbook links.
  • Import Excel sheets from your files to a single Excel workbook and even automate the import on a schedule.

The latter option seems to be the most actionable one, so let’s dive in.

Merge multiple Excel files into one sheet

We have three Excel files on OneDrive with one worksheet each. 

3.1 merge excel files online

Let’s merge the data from these files into one sheet in the workbook Excel-File-1. The Excel integration by Coupler.io will do the job with just a few clicks.

Coupler.io is a data integration tool that allows you to schedule imports from multiple sources, such as Excel, CSV, Airtable, and many others to Microsoft Excel, Google Sheets, or Google BigQuery.

Sign up to Coupler.io with your Microsoft account, click Add importer, then select Microsoft Excel both as a source and destination app. Check out other Excel integrations.

3.2 merge excel files online

Then proceed with the setup.

Source

  • Connect your Microsoft account.
  • Select an Excel file on OneDrive and a sheet to take data from. You can select multiple sheets from a single file, but the data extracted from them will be merged into one sheet.

3.3 merge excel files online source

Destination

  • Connect your Microsoft account.
  • Select an Excel file on OneDrive and a sheet where to load the data. 

3.4 merge excel files online destination

  • Select the Append import mode to have your imported data merged not replaced.

3.5 merge excel files online append mode

You can now click Save and Run to load the data. Here is the result:

3.6 merge excel files online merge point

However, this merged data is from only two files, while we have three. You need to set up another integration for the third file. You can make a copy of this integration to speed up the setup. Click the three dots on the top-right and select Copy.

3.7 merge excel files online copy

Then replace the source file and keep the destination settings unchanged.

3.8 merge excel files online copy importer

Note: Double-check the Sheet in the Destination settings since it may be suggested that you make a copy of it. 

Now you can click Save and Run to add the data from the third Excel file to the already merged rows from two Excel files.

How to automatically merge Excel files

Coupler.io allows you to schedule imports of data from the Excel files you want to merge. So, you can combine multiple Excel files into one automatically.

For this, you need to enable the Automatic data refresh feature and configure the desired schedule. You can do this either when setting up your importer:

12.Coupler.io schedule

Or do this at any time later in the admin panel:

3.9 automatically merge excel files online

Merge Excel files with Power Query

Excel Power Query is a built-in data transformation engine that allows you to perform basic and advanced transformations with your data. Let’s see how it can cope with merging Excel files.

How to merge 3 Excel files into one

Again, we have three Excel files with one worksheet each. Locate all the files in one folder. 

  • Open a new Excel workbook. Go to New Query=> From File => From Folder

4.1 merge excel files power query new query

  • Browse and select the folder with your Excel files.

4.2 merge excel files power query path

  • On the next step, you’ll have three options:
    • Combine and Transform Data – choose this if you want to manipulate the data before merging it.
    • Combine and Load – choose this if you want to merge Excel files right away.
    • Combine and Load To… – choose this if you want to merge Excel files into another workbook.

4.3 merge excel files power query combine and load

  • On the next step, you can optionally select the object to extract from each file. Click OK.

4.4 merge excel files power query select object

  • Eventually, your files are merged into one.

4.5 merge excel files power query results

Merge 2 Excel files based on a column

Let’s solve a more complex task of merging Excel files using Power Query. We have two Excel files with one worksheet each, and we need to merge them based on a key column. In our example, let’s merge the rows that have matches based on the first_name value, if any. Here is the flow:

  • Open a new Excel workbook. Go to New Query => From File => From Workbook.

5.1 merge excel files power query new query workbook

  • Select a file and a sheet, then click Load. The data will be loaded in the form of a table.

5.2 merge excel files power query table

  • Repeat these steps to load data from the second file. As a result, you’ll have two queries.

5.3 merge excel files power query two queries

  • Go to the Query tab, then select Merge.

5.4 merge excel files power query

  • Select tables and matching columns to merge data. Once you do this, you’ll see the number of rows that match based on the selected key column. Click OK to proceed.

5.5 merge excel files power query select tables and columns

  • Then you’ll see a preview of the merged queries in the Power Query Editor.

5.6 merge excel files power query preview

If you’re not going to make any additional manipulations, click Close & Load. Here is the result.

5.7 merge excel files power query merged queries

How to merge two Excel files and remove duplicates

To remove duplicates during the process of merging Excel files, you’ll need to repeat the flow we described in the previous section. And on the step of a preview of the merged queries in the Power Query Editor, go to Home => Remove Rows => Remove Duplicates.

5.8 remove duplicates

And that’s it 🙂

How to combine multiple Excel files into one workbook and compare them

The flow that we described in the section about merging two Excel files based on a column will let you merge and compare files. You’ll need to choose a key column to compare the data from both files, and then you’ll see whether there are any matches. 

Combine data from multiple Excel files into one pivot table

Let’s add another condition to our task – combine multiple Excel workbooks into one pivot table. The Power Query will let you do this easily. For this, you’ll need first to consolidate your files as we described above. Once you have the data consolidated in one table/sheet, click the Summarize with PivotTable button in the Design menu.

pivot table

After that, you can configure the pivot table to your needs.

pivot table 2

How to combine multiple Excel files into one worksheet using macro

Excel macros are pieces of code that can implement specific actions including merging Excel files. In our guide on Excel macros, you can learn more about using and creating macros. 

And here, we’d like to introduce a few ready-to-use VBA macros to optimize the consolidation of data from multiple Excel files.

  • Go to the Developer tab => Visual Basic

6.1 excel vba macro merge excel files

  • Go to Insert => Module
6.2 excel vba macro merge excel files insert module
  • In the open window, enter one of the following scripts and run it.

6.3 excel vba macro merge excel files run module

Excel VBA macro to combine multiple Excel files into one workbook

This macro will combine all open Excel files into one new workbook.

Sub MergeFilesNewWorkbook()
On Error GoTo eh
'declare variables to hold the objects required
 Dim wbDestination As Workbook
 Dim wbSource As Workbook
 Dim wsDestination As Worksheet
 Dim wb As Workbook
 Dim sh As Worksheet
 Dim strSheetName As String
 Dim strDestName As String
 Dim iRws As Integer
 Dim iCols As Integer
 Dim totRws As Integer
 Dim strEndRng As String
 Dim rngSource As Range
'turn off the screen updating to speed things up
 Application.ScreenUpdating = False
'first create new destination workbook
 Set wbDestination = Workbooks.Add
'get the name of the new workbook so you exclude it from the loop below
 strDestName = wbDestination.Name
'now loop through each of the workbooks open to get the data
 For Each wb In Application.Workbooks
 If wb.Name <> strDestName And wb.Name <> "PERSONAL.XLSB" Then
 Set wbSource = wb
 For Each sh In wbSource.Worksheets
'get the number of rows and columns in the sheet
 sh.Activate
 ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Activate
 iRws = ActiveCell.Row
 iCols = ActiveCell.Column
'set the range of the last cell in the sheet
 strEndRng = sh.Cells(iRws, iCols).Address
'set the source range to copy
 Set rngSource = sh.Range("A1:" & strEndRng)
'find the last row in the destination sheet
 wbDestination.Activate
 Set wsDestination = ActiveSheet
 wsDestination.Cells.SpecialCells(xlCellTypeLastCell).Select
 totRws = ActiveCell.Row
'check if there are enough rows to paste the data
 If totRws + rngSource.Rows.Count > wsDestination.Rows.Count Then
 MsgBox "There are not enough rows to place the data in the Consolidation worksheet."
 GoTo eh
 End If
'add a row to paste on the next row down
 If totRws <> 1 Then totRws = totRws + 1
 rngSource.Copy Destination:=wsDestination.Range("A" & totRws)
 Next sh
 End If
 Next wb

'clean up the objects to release the memory
 Set wbDestination = Nothing
 Set wbSource = Nothing
 Set wsDestination = Nothing
 Set rngSource = Nothing
 Set wb = Nothing
'turn on the screen updating when complete
 Application.ScreenUpdating = False
Exit Sub
eh:
MsgBox Err.Description
End Sub

Excel VBA macro to merge all open Excel files into an existing workbook

This macro will combine all open Excel files into one existing workbook.

Sub MergeFilesExistingWorkbook()
 On Error GoTo eh
'declare variables to hold the objects required
 Dim wbDestination As Workbook
 Dim wbSource As Workbook
 Dim wsDestination As Worksheet
 Dim wb As Workbook
 Dim sh As Worksheet
 Dim strSheetName As String
 Dim strDestName As String
 Dim iRws As Integer
 Dim iCols As Integer
 Dim totRws As Integer
 Dim rngEnd As String
 Dim rngSource As Range
'set the active workbook object for the destination book
 Set wbDestination = ActiveWorkbook
'get the name of the active file
 strDestName = wbDestination.Name
'turn off the screen updating to speed things up
 Application.ScreenUpdating = False
'first create new destination worksheet in your Active workbook
 Application.DisplayAlerts = False
'resume next error in case sheet doesn't exist
 On Error Resume Next
 ActiveWorkbook.Sheets("Consolidation").Delete
'reset error trap to go to the error trap at the end
 On Error GoTo eh
 Application.DisplayAlerts = True
'add a new sheet to the workbook
 With ActiveWorkbook
 Set wsDestination = .Sheets.Add(After:=.Sheets(.Sheets.Count))
 wsDestination.Name = "Consolidation"
 End With
'now loop through each of the workbooks open to get the data
 For Each wb In Application.Workbooks
 If wb.Name <> strDestName And wb.Name <> "PERSONAL.XLSB" Then
 Set wbSource = wb
 For Each sh In wbSource.Worksheets
'get the number of rows in the sheet
 sh.Activate
 ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Activate
 iRws = ActiveCell.Row
 iCols = ActiveCell.Column
 rngEnd = sh.Cells(iRws, iCols).Address
 Set rngSource = sh.Range("A1:" & rngEnd)
'find the last row in the destination sheet
 wbDestination.Activate
 Set wsDestination = ActiveSheet
 wsDestination.Cells.SpecialCells(xlCellTypeLastCell).Select
 totRws = ActiveCell.Row
'check if there are enough rows to paste the data
 If totRws + rngSource.Rows.Count > wsDestination.Rows.Count Then
 MsgBox "There are not enough rows to place the data in the Consolidation worksheet."
 GoTo eh
 End If
'add a row to paste on the next row down if you are not in row 1
 If totRws <> 1 Then totRws = totRws + 1
 rngSource.Copy Destination:=wsDestination.Range("A" & totRws)
 Next sh
 End If
 Next wb
 
'clean up the objects to release the memory
 Set wbDestination = Nothing
 Set wbSource = Nothing
 Set wsDestination = Nothing
 Set rngSource = Nothing
 Set wb = Nothing
'turn on the screen updating when complete
 Application.ScreenUpdating = False
Exit Sub
eh:
MsgBox Err.Description
End Sub

Excel VBA macro to combine multiple Excel files into one workbook as separate sheets

This macro will combine all open Excel files into one new workbook and keep them as separate sheets.

Sub MergeFilesSeparateSheets()
On Error GoTo eh
    'declare variables to hold the objects required
Dim wbDestination As Workbook
Dim wbSource As Workbook
Dim wsSource As Worksheet
Dim wb As Workbook
Dim sh As Worksheet
Dim strSheetName As String
Dim strDestName As String
    'turn off the screen updating to speed things up
Application.ScreenUpdating = False 'first create new destination workbook
Set wbDestination = Workbooks.Add 'get the name of the new workbook so you exclude it from the loop below
strDestName = wbDestination.Name 'now loop through each of the workbooks open to get the data but exclude your new book or the Personal macro workbook
For Each wb In Application.Workbooks
If wb.Name <> strDestName And wb.Name <> "PERSONAL.XLSB" Then
Set wbSource = wb
For Each sh In wbSource.Worksheets
sh.Copy After:=Workbooks(strDestName).Sheets(1)
Next sh
End If
Next wb

Application.DisplayAlerts = True 'clean up the objects to release the memory
Set wbDestination = Nothing
Set wbSource = Nothing
Set wsSource = Nothing
Set wb = Nothing 'turn on the screen updating when complete
Application.ScreenUpdating = False
Exit Sub
eh:
    MsgBox Err.Description
End Sub

Wrap-up: Merge CSV files in Excel

As a wrap-up, we decided to touch on how to merge CSV files in Excel. Actually, there is nothing complex since most of the methods above allow you to do this. Once you open a CSV file in Excel, it will look like a regular workbook, so you can use Power Query or VBA macros to merge them.

If your CSV files are stored online, you can easily merge them using Coupler.io in the same way we did with Excel files. The only difference is that you won’t need to select a sheet. Choose the best option for your needs and optimize your workflow as much as possible. Good luck with your data!

  • Zakhar Yung

    A content manager at Coupler.io whose key responsibility is to ensure that the readers love our content on the blog. With 5 years of experience as a wordsmith in SaaS, I know how to make texts resonate with readers’ queries✍🏼

Back to Blog

Focus on your business

goals while we take care of your data!

Try Coupler.io

Skip to content

How to Merge Two Spreadsheets in Excel (Consolidate) – 2023

How To Merge Two Spreadsheets in Excel (Consolidate) – 2023

We frequently need to summarize data from multiple Excel files or Excel sheets.

It is difficult to use formulas to combine multiple Excel files into a single sheet.

Formulas are prone to mistakes 🚧

Excel provides clever techniques for combining data from multiple sheets or excel files into a single sheet.

One of them is Excel consolidation 😍

You can practice with me by downloading the Excel workbooks here.

Let’s get started. 👍

Combine Excel sheets with ‘Consolidate’

First, let’s learn how to combine data from multiple sheets.

Here we have regional sales data for 4 weeks.

Week 1 sales
Week 2 sales
Week 3 sales
Week 4 sales

Each week’s sales are in its own Excel sheet in the same workbook.

Product names and regions are not in the same order 🤔

Make sure that no data list contains any blank rows or columns⚠️

Kasper Langmann, Microsoft Office Specialist

Now we want to combine all the data and create the monthly sales table (for all 4 weeks).

We will add a new sheet as “Master”. This sheet will serve as the destination sheet for the consolidated data.

  1. Select a cell in that master sheet to place our sales summary and go to the data tab.
Merge sheets - Go to the data tab
  1. Select “Consolidate” from the data tools group.

Then, you can see the “consolidate” dialog box.

Dialog box to consolidate data
  1. Select the consolidate method from the “Function box”.

In this example, we want to get the total of all the sheets. So, we select “Sum”.

There are several functions to combine Excel sheets such as SUM, COUNT, AVERAGE, MAX, MIN, PRODUCT, etc.

As we want to combine data to get the total of multiple worksheets, we select the “SUM” function.

Kasper Langmann, Microsoft Office Specialist
Functions to merge data in Microsoft Excel
  1. Click the collapse button of the reference box.

Then click on a single worksheet that contains merging data and select the data in that Microsoft Excel sheet. In this case, we first select sales data in the “Week 1” sheet.

Click collapse button to select source data to combine sheets
Selecting sales data in Week 1 sheet
  1. Click the expand dialog button and click the “Add” button. Then the data range will be added to the “All references”.
Click the Expand button

Repeat this step to get all the data in all the worksheets.

Pro Tip!

When you click on the other Excel sheets to get merging data, look at the reference!

Microsoft Excel will apply the previous cell range for the new worksheet as the reference.

If the data in all the sheets are in the same structure and the same layout, you can just click the “Add” button after you select the next worksheet 🥳

Now, it should look like this.

All references from multiple sheets
  1. Check the boxes for “Top row” and “Left column” to add labels to the merged data table. Then all column headers and row labels will be copied to the merged data table.
Adding row and column labels

You must make sure the unique labels are the same in merge sheets.

Microsoft Excel will show the unique labels as separate column headings if they contain any typos or differences⚠️

Kasper Langmann, Microsoft Office Specialist
  1. Check the box – “Create links to source data” and click “Ok”.
Combine data in Microsoft Excel - create link to source data

Do you want to manually update consolidated data in the master spreadsheet?

Then do not check the box – “Create links to source data”.

Kasper Langmann, Microsoft Office Specialist

Microsoft Excel will generate a consolidated data report in a single sheet by combining all the data of the selected sheets of the Excel file.

Summary of the Excel file.

Now you know how to combine data in one file.

Combine multiple Excel files with ‘Consolidate’

In reality, most of the time we collect data in multiple files.

So, we need to combine multiple excel files to get the consolidated data 🤨

In Microsoft Excel, we can combine data from multiple workbooks as well 🤗

  1. To merge Excel files, first, open all the Excel files to be merged. Before you start the process, it is better to save all the files in the same folder.
Open all the Excel workbooks
  1. Create a new workbook and follow steps 1- 3 and 6-7 to combine excel sheets in the new Excel workbook.

Now, the “consolidate” dialog box should look like this.

Following steps 1-3 and 6-7 that are used to combine data from multiple sheets in the same Excel workbook.
  1. Click the collapse button in the reference box and select the data ranges in Excel files one by one.

If the Excel spreadsheets are closed, click “Browse…” to locate the workbooks. You can see the folder path to the Excel workbook in the reference box. Then, manually enter the cell range after the exclamation mark of the folder path.

Browse and select the folder path
All references show file path to each workbook.

When you click “Ok”, you can get the data from separate files to one workbook.

Combined workbook - Merge workbooks

Pro Tip:

If you want to quickly go to the cell ranges of each workbook, you can apply name ranges to those ranges.

It is superfast and more accurate💪🏻

You can read the named ranges article to learn more about it.

That’s it – Now what?

You no longer need to manually enter formulas in the master spreadsheet to prepare a summary 🤩

This is only one of the many ways to merge data from several Excel sheets or files.

Do you know that you can combine multiple worksheets using VBA codes?

Yes, you can combine multiple excel files using VBA too.

You can access my free 30-minute online course on “Vigorous VBA” by clicking here 🧑🏻‍🎓

Other resources

The Consolidate tool in Microsoft Excel appears to be a Pivot Table.

However, Pivot Tables offer more flexibility than Excel Consolidate. Therefore, use Pivot Tables if you need more flexibility to make changes to the summary table.

You can read our articles about power query and VBA codes and use them to merge files in Microsoft excel 👍

Frequently asked questions

Yes, you can combine multiple files.

  1. Open all the files.
  2. Create a new Excel spreadsheet and select a cell where you want to have the upper left cell of the merged data.
  3. Click the “Consolidate” in the “data tab”.
  4. Select the function to combine multiple files.
  5. Pull data from multiple excel files by clicking the collapse button in the reference box. Click “Add” each time you select data from a new Excel spreadsheet.
  6. Click “Ok”.

It is one of the Microsoft Excel features to merge data into one file from multiple sheets or multiple files.

It can merge several sheets or several Excel spreadsheets easily and accurately into a new sheet.

  1. Copy the data from multiple sheets into one sheet.
  2. Select the data in the entire sheet.
  3. Go to the “Remove duplicates” in the Data tab.
  4. If you have copied headers from all the files, do not check the “My data has headers”.
  5. Click “Ok”. Now, data in separate sheets are combined into one sheet without duplicates.

Kasper Langmann2023-01-09T19:23:33+00:00

Page load link

If you’re a Microsoft Excel user, it doesn’t take long before you have many different workbooks full of important spreadsheets. What happens when you need to combine these multiple workbooks together so that all of the sheets are in the same place?

Excel can be challenging at times because it’s so powerful. You know that what you want to do is possible, but you might not know how to accomplish it. In this tutorial, I’ll show you several techniques you can use to merge Excel spreadsheets.

When you need to combine multiple spreadsheets, don’t copy and paste the data from each sheet manually. There are many shortcuts that you can use to save time in combining workbooks, and I’ll show you which one is right for each situation.

Combine Excel SpreadsheetsCombine Excel SpreadsheetsCombine Excel Spreadsheets

Watch & Learn

The screencast below will show you how to combine Excel sheets into a single consolidated workbook. I’ll teach you to use PowerQuery (also called Get & Transform Data) to pull together data from multiple workbooks.

Important: The email addresses used in this tutorial are fictitious (randomly generated) and not intended to represent any real email addresses.

Read on to see written instructions. As always, Excel has multiple ways to accomplish this task, and how you’re working with your data will drive which approach is the best.

1. How to Move & Copy Sheets (Simplest Method)

The easiest method to merge Excel spreadsheets is to simply take the entire sheet and copy it from one workbook to another.

To do this, start off by opening both Excel workbooks. Then, switch to the workbook that you want to copy several sheets from.

Now, hold Control (or Command on Mac) on your keyboard and click on all of the sheets that you want to copy to a separate workbook. You’ll notice that as you do this, the tabs will show as highlighted.

Now, simply right click and choose Move or Copy from the menu.

Move or Copy from MenuMove or Copy from MenuMove or Copy from Menu

Control+click (or command+click) on all of the sheets that you want to move or copy between workbooks, then right click and choose Move or Copy.

On the Move or Copy pop up window, the first thing that you’ll want to do is select the workbook that you want to move the sheets to. Choose the name of the file from the «To book» drop-down.

Move or Copy Popup OptionMove or Copy Popup OptionMove or Copy Popup Option

On the pop-up window, choose the workbook that you want to copy or move your sheets into, and ensure that you check Create a copy if you don’t want to move all of the sheets.

Also, you can choose where the sheets are placed in the new workbook in terms of sequence. The Before sheet menu controls where sequentially in the workbook the sheets will be inserted. You can always choose (move to end) and re-sequence the order the sheets later as needed.

Finally, it’s optional check the box to Create a copy, which will duplicate the sheets and create a separate copy of them in the workbook you’re moving the sheets to. Once you press OK, you’ll see that the sheets we copied are in the combined workbook.

Sheets in Excel workbookSheets in Excel workbookSheets in Excel workbook

Now, the two sheets we selected from a separate workbook are copied into the main workbook.

This approach has a few downsides. If you keep working with two separate files, they aren’t «in sync.» If you make changes to the original workbook that you copied the sheets from, they won’t automatically update in the combined workbook.

2. Prepare to Use Get & Transform Data Tools to Combine Sheets

Excel has an incredibly powerful set of tools that are often called PowerQuery. Beginning with Excel 2016, this feature set was rebranded as Get & Transform Data. 

As the name suggests, these are a set of tools that helps you pull data together from other workbooks and consolidate it into one workbook.

Data Get and Transform Excel ribbonData Get and Transform Excel ribbonData Get and Transform Excel ribbon

In Excel 2016 for Windows or the Office365 version of Excel, you’ll find this feature on the Data tab in the Get & Transform options.

Also, this feature is exclusive to Excel for Windows. You won’t find it in the Mac versions or in the web browser edition of Microsoft’s app.

Before You Start: Check the Data

The most important part of this process is checking your data before you start combining it. The files need to have the same setup for the data structure, with the same columns. You can’t easily combine a four-column spreadsheet and a five-column spreadsheet, as Excel won’t know where to place the data.

Compare data setsCompare data setsCompare data sets

Before you try to combine data with Get & Transform Data feature, it really helps to ensure that the data is in the same structure, with the same columns in each workbook you’re combining.

Often, you’ll find yourself needing to combine spreadsheets when you’re downloading data from systems. In that case, it’s much easier to make sure the system you’re downloading data is configured to download data in the same columns each time.

Before I download data from a service like Google Analytics, I always make sure that I’m downloading the same report format each time. This ensures that I can easily work with and combine multiple spreadsheets together.

Whether you’re pulling data from a system like Google Analytics, MailChimp, or an ERP like SAP or Oracle that powers huge companies, the best way to save time is to ensure that you’re downloading data in a common format.

Now that we’ve checked our data, it’s time to dive into learning how to combine Excel sheets. 

3. How to Combine Excel Sheets in a Folder Full of Files

A few times, I’ve had a folder full of files that I needed to put together into a single, consolidated file. When you’ve got dozens or even hundreds of files, opening them one-by-one to combine them just isn’t feasible. Learning this technique can save you dozens of hours on a single project.

Again, it’s crucial that the data is in the same format. To get started, it helps to place all of the files in the same folder so that Excel can easily watch this folder for changes. 

Combining Folder of filesCombining Folder of filesCombining Folder of files

Make sure that you’ve placed all of your Excel files in the same folder, then choose New Query > From File > From Folder on Excel’s ribbon.

Step 1. Point Excel to the Folder of Files

On the pop-up window, you’ll want to specify a path to the folder that holds your Excel workbooks.

Folder Path Microsoft ExcelFolder Path Microsoft ExcelFolder Path Microsoft Excel

Set the folder path to the folder with the files you want to combine.

You can browse to that path, or simply paste in the path to the folder with your workbooks.

Step 2. Confirm the List of Files

After you show Excel where the workbooks are stored, a new window will pop up that shows the list of files you’re set to combine. Right now, you’re only seeing metadata about the files, and not the data inside of it.

List of files to combineList of files to combineList of files to combine

This window simply shows the files that are going to be combined with our query, 

This window simply shows the files that are going to be combined with our query. You’ll see the file name, the type, and the dates accessed and modified. If you’re missing a file in this list, confirm that all of the files are in the folder and retry the process.

To move on to the next step, click on Edit. 

Step 3. Confirm the Combination

The next menu helps to confirm the data inside your files. Since we’ve already checked that data is the same structure in our multiple files, we can simply click OK on this step.

Confirm Combining Files ExcelConfirm Combining Files ExcelConfirm Combining Files Excel

This is a check-step to ensure that our files are in the same structure, so simply press OK to move to the next step.

Step 4. How to Combine Excel Sheets With a Click

Now, a new window pops up with the list of files we’re set to combine.

At this stage, you’re still seeing metadata about the files and now the data itself. To solve that, click on the double drop-down arrow in the upper right corner of the first column.

Click to Combine FilesClick to Combine FilesClick to Combine Files

Click on the double drop-down arrow in the first column to load the source data from each file.

Voila! Now, you’ll see the actual data from inside the files combined into one place. 

Query Editor Data CombinedQuery Editor Data CombinedQuery Editor Data Combined

Once you combine your data, you’ll see all of it combined into one file, and the original filename shows in the first column.

Scroll through the data to confirm that all of your rows are there. Notice that the only change from your original data is that the filename of each source file is in the first column.

Step 5. Close and Load the Data

Believe it or not, we’re basically finished with combining our Excel spreadsheets. The data is in the Query Editor for now, so we’ll need to «send it back» to regular Excel so that we can work with it.

Click on Close & Load in the upper right corner. You’ll see the finished data in a regular Excel spreadsheet, ready to review and work with.

Combined Data Set in ExcelCombined Data Set in ExcelCombined Data Set in Excel

Once you click Close & Load, you’ll see all of the data from the original files combined into one sheet.

Imagine using this feature to roll up multiple files from different members of your team. Choose a folder that you’ll each store files in, and then combine them into one cohesive file with this feature in just a few minutes.

Recap & Keep Learning

In this tutorial, you learned several techniques for how to combine Excel sheets. When you’ve got many sheets that you need to stitch together, using one of these approaches will save you time so that you can get back to the task at hand!

Check out some of the other tutorials to level up your Excel skills. Each of these tutorials will teach you a method for accomplishing tasks in less time in Microsoft Excel.

How do you merge Excel workbooks? Let me know in the comments section below whether you’ve got a preference for these methods, or a technique of your own that you use.

Did you find this post useful?

Andrew Childress

I believe that life is too short to do just one thing. In college, I studied Accounting and Finance but continue to scratch my creative itch with my work for Envato Tuts+ and other clients. By day, I enjoy my career in corporate finance, using data and analysis to make decisions.

I cover a variety of topics for Tuts+, including photo editing software like Adobe Lightroom, PowerPoint, Keynote, and more. What I enjoy most is teaching people to use software to solve everyday problems, excel in their career, and complete work efficiently. Feel free to reach out to me on my website.

Понравилась статья? Поделить с друзьями:
  • Merge tables for excel
  • Merge letter templates in word
  • Merge from word to pdf
  • Merge from excel to excel
  • Merge files with excel