Pivot Table Using Multiple Files

A pivot table is one of the best ways to summarize data. You can create a summary report within seconds from thousands of rows of data.

It’s a perfect tool.

But while working with data in the real world not everything is perfect. And today, I want to share with you a common problem which we all face.

Before I start, I want to say thanks to Raman Girdhar for his question. He has been following up with me for quite long time.

Sometimes we receive or capture our data in different workbooks and in that case creating a pivot table need some extra efforts for combining those multiple workbooks into one.

Only after that, we can create a pivot table.

So in this post, I’d like to show you a 3 steps process to create a pivot table by using data from multiple workbooks.

So let’s get started.

Steps to Create a Pivot Table using Data from Multiple Workbooks

Important: For this, we need to use power query.

Make sure you have power query in your Excel version. For Excel 2016, it’s there on the Data tab and for other versions (2010 and 2013) you need to install the add-on.

Here I have four different workbooks with sales data for different zones. You can download these files from here to follow along.

And, make sure you have all these files in a single folder.

Step 1 - Combine Files using Power Query

First of all, we need to combine all the files into one table with power query.

  • Go to Data Tab -> Get Transformation -> New Query -> From File -> From Folder.
  • Now, from the folder selection window, click on “Browse” and select the folder where you have all the files.
  • Click OK.
  • From here, you’ll get a “Combine Files” window.
  • And from that window, select the worksheet in with you data in all the workbooks. (Quick Tip: Make sure to have the same worksheet name in all the workbooks).
  • Once you click OK and it will edit all the data from the workbooks into power query editor.

Step 2 - Prepare Data for the Pivot Table

Now, we need to make little changes in our data to make it ready for a pivot table.

  • If you look at the data we have got an extra column here with the name of the source file.
  • Right click on this column and select Split Column -> By Delimiter.
  • From delimiter window, select custom, add “-” as a delimiter, and select “Left-most delimiter”.
  • Click OK.
  • After that, delete the second column.
  • Now, rename the first column.
  • One more thing, right-click on the first column again and go to Transform -> Capitalize Each Word.
  • And, now your data is ready. So, click on close and load.

Step 3 - Insert the Pivot Table

At this point, we have a new worksheet in our workbook with the combine data from all the four files.

Now, it’s time to create a pivot table from it.

  • Select the table and go to Insert Tab and click on the Pivot Table button.
  • Here you’ll get an insert pivot table window.
  • Click OK on insert pivot table window and you’ll get new pivot table in your workbook.

Congratulations! you have successfully created a new pivot table from different files.

Refresh Pivot Table

I’m sure you are thinking about how to refresh your pivot table after updating source files.

It’s simple.

To refresh your pivot table you need to update the query so that the data from the source file can be updated in the source table which you created with power query. And after that, you can update your pivot table.

But, the simple and best way is to use refresh button from the data tab. It will refersh both (Pivot Table + Query).

Important Points

Here I have listed some points which you need to remember while using power query for a pivot table.

  • Files should be in a single folder.
  • Data should be in the same format in all the files. Otherwise, you need to make it usable after combining from it.
  • Name of the worksheets should be same in all the files.
  • Make sure you don’t have any error in any file. Or you can use “Skip error files” option.
  • Don’t rename any workbook.


Because of power query creating a pivot table with multiple files is like a cup of cake. You just need to follow simple instructions.

And the best thing is it’s a one time set up, there is nothing to do again and again other than refresh the query. It can save you a ton of time and a lot of efforts.

I hope you are happy with this tip and found it useful in your work.

Now tell me one thing. Have you ever tried to create a pivot table from different workbooks? Do you have any other method to create to this? Please share with me in the comment section, I would love to hear from you.

And, please don’t forget to share this tip with your friends. They need this thing too.

Must Read Next

  1. How To Create a Pivot table Using VBA
  2. How to Create a Pivot Table from Multiple Worksheets
  3. 30 Pivot Table Tips & Tricks
  4. How to Add Custom Field and Item in a Pivot Table
  5. How to Refresh All Pivot Tables at Once

Content Protection by DMCA.com


  1. Sandeep 11 Sep, 18 at 9:15 am - Reply

    sir, unable to download data files

  2. Gabber Singh D 11 Nov, 17 at 9:10 am - Reply

    Can we create different charts by using single pivot? Now I’m using individual pivot for different chart so it’s consuming more size. Please suggest if any

  3. Raman Girdhar 5 Jul, 17 at 11:12 am - Reply

    Hi Puneet, Thank you so much for posting this on my request.
    I have a query. please refer to your step where you have asked about the “Combine Files” window. I am getting this window, however, I am not getting the “combine” button at the bottom. I am only getting rest of the three buttons – “Load”, “Edit” and “Cancel”. I am using MS Excel 2013. Any alternate for 2013 version ?

    • Raman Girdhar 15 Jul, 17 at 3:01 am - Reply

      Any update on this @Puneet ?

      • Puneet Gogia 24 Jul, 17 at 3:12 pm - Reply

        Please update your add-in. Better to re-install.

  4. Sailaja Perumalla 26 Jun, 17 at 8:32 am - Reply

    Hey Puneet,
    I am using pivot table as a part of my task. Now I was able to calculate percentages, multiplication, subtraction, addition etc., but unable to apply “if condition with 2 and more conditions” along with conditional formatting. Can you please assist on this.

    • Puneet Gogia 26 Jun, 17 at 8:45 am - Reply

      share with me at puneet [at] gogia [dot] me

      • Sailaja Perumalla 26 Jun, 17 at 4:15 pm - Reply


        • Sailaja Perumalla 27 Jun, 17 at 4:52 am - Reply

          Hello Puneet,
          Any solution for the query posted?

          • Puneet Gogia 27 Jun, 17 at 4:59 am

            @sailajaperumalla:disqus didn’t received any thing. Please resend to puneet@gogia.me

          • Sailaja Perumalla 27 Jun, 17 at 5:28 am

            @puneet_gogia:disqus I just sent.

          • Puneet Gogia 27 Jun, 17 at 3:44 pm

            @sailajaperumalla:disqus Yeah, got it. Let me check and I’ll reply you back.

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.