Create an Excel PivotTable from a Sheet in Another Workbook

To build a PivotTable from another Excel workbook, choose a connection to its table or open both workbooks and select the source cells directly. Whether you can refresh with the source workbook closed depends on the connection. Power Query offers another way to read a saved workbook repeatedly.

Prepare the source and report workbooks

In desktop Excel for Windows, use Excel_1.xlsx for source data and Excel_2.xlsx for the report. Give each source column a unique header, such as Product, Quantity, Unit Price, and Sales. Enter one transaction per row. For a named source table, select a data cell, press Ctrl+T, check that the table has headers, and save. Keep both workbooks open.

Product Quantity Unit Price Sales
A 1 300 300
B 6 67 402
C 4 34 136
D 100 100 10000
A 2 200 400
B 4 89 356
B 6 23 138
C 8 45 360

Choose a source table through an external connection

  1. In the report workbook, go to Insert and open PivotTable.
  2. Choose From External Data Source or Use an external data source, then select Choose Connection.
  3. Pick the connection you want. If the Tables tab lists the table from Excel_1.xlsx, select it and open it. The entries depend on the connection and your version of Excel.
  4. Choose a new worksheet or an empty cell in the report workbook as the destination, then confirm.
  5. In PivotTable Fields, put Product in Rows and Sales in Values. Check that the report shows the sum of Sales.
  6. Change and save the source data, then select PivotTable Analyze → Refresh. Check that the updated amount appears in the total.

With the sample rows, product A should total 700 and all products should total 12092. If you change the first sale for A from 300 to 600 and save, refreshing should show 1000 for A and 12392 overall.

If the table is absent, use the range method below or Power Query. The table connection in the original example displayed an error asking the reader to open the source workbook again.

Microsoft’s guide to PivotTables with external data sources

Select a sheet range in the other workbook

  1. In Excel_2.xlsx, choose Insert → PivotTable → From Table/Range. Older versions use the Select a table or range option in the dialog.
  2. Open the range selector and switch to the open Excel_1.xlsx workbook. On Sheet1, select A1:D9, including its headers.
  3. Place the PivotTable in a new worksheet or an empty cell in the report workbook. Confirm that you are creating the report in the intended file.
  4. Put Product in Rows and Sales in Values, then check the sum. Edit an existing sale in the source, save it, and refresh to verify the change.
  5. If you add rows below the selected range, use PivotTable Analyze → Change Data Source to include them, then refresh.

If you add product E with sales of 1000, the total increases by 1000 once the source covers the new row. With a fixed range, check the source reference whenever you append rows beyond it.

Microsoft’s guide to creating PivotTables

Microsoft’s guide to changing a PivotTable data source

Check why a refresh fails

Save the source workbook, then check whether its file name or path changed and whether your account can open it. Some connections refresh after you reopen the source workbook. If the total stays the same, check that the source covers the edited rows, that Sales contains numbers, and that the value field uses Sum. A shared report can retain source data in its PivotTable cache.

Microsoft’s guide to refreshing PivotTable data

Microsoft’s explanation of the PivotTable cache

Use Power Query to import the saved file repeatedly

  1. In the report workbook, choose Data → Get Data → From File → From Excel Workbook.
  2. Select Excel_1.xlsx, then pick a table or sheet in Navigator.
  3. Load the data to a table in the report and create a PivotTable from that table.
  4. After saving the source, refresh the query and the PivotTable in the report and check the totals.

A named table simplifies source range maintenance when you add rows frequently.

Microsoft’s guide to importing Excel workbooks with Power Query