Skip to content

Refresh a PivotTable and change its source

More from PivotTables8 minPremium

Builds on Summarize a list with a PivotTable.

A finance assistant in Frankfurt adds the week's invoices to the bottom of the invoice list every Monday. The PivotTable on the next sheet still shows last week's totals, and last month a manager asked why the report and the list didn't match.

How it works

A PivotTable works from its own copy of the data, the PivotTable cache. Editing the list doesn't change the PivotTable, and Excel doesn't warn you that the two no longer match, so refresh it after every change.

  • PivotTable Analyze > Refresh, or AltF5 in Excel for Windows, refreshes the PivotTable you're in. Right-clicking it and choosing Refresh does the same.
  • Data > Refresh All, or CtrlAltF5, refreshes every PivotTable and query in the workbook.
  • On a Mac, choose PivotTable Analyze > Refresh.

A refresh reads the same range as before, so rows typed under the old end of the list stay out. Widen the range with PivotTable Analyze > Change Data Source. Better, make the list an Excel table with CtrlT (CmdT on a Mac) and use the table as the source. A table grows with each row you add, and the next refresh takes the new rows in.

To refresh whenever the workbook opens, check Refresh data when opening the file in PivotTable Options, on the Data tab. Automatic refresh is only a preview for Microsoft 365 Insiders so far, so plan on refreshing by hand.

Example

The assistant's PivotTable was built on A1:C8. On Monday she types two invoices into rows 9 and 10 and refreshes, and the totals don't move.

A PivotTable built on A1:C8 never reads past row 8, even after a refresh. Widen the source to take in rows 9 and 10, or build the PivotTable on a table, which grows with each row you add.

Common mistakes

  • Typing over a number in the PivotTable. Excel refuses, because the figures come from the list. Change the list, then refresh.
  • Refreshing after adding rows under a range. The rows stay out until you change the source or switch it to a table.
  • Refreshing one PivotTable in a workbook that has several. The others can stay out of date. Use Refresh All.

The other reasons a PivotTable shows the wrong numbers, such as a count where you expected a sum, are in How to create a pivot table in Excel.

In short

  • A PivotTable keeps a copy of its data, so refresh it after the list changes: Alt+F5 on Windows, or Refresh All for the whole workbook.
  • Rows added under a range need Change Data Source. With a table as the source, the next refresh takes them in.
  • Refresh data when opening the file keeps a shared workbook up to date.

Practice

Premium

4 exercises: 1 quiz question, 1 set of steps, 1 find-it task and 1 shortcut.

Practice is part of Premium

Every lesson is free to read, and you can practice the free lessons without an account. This lesson's exercises are part of Premium, which you add to a free account.