Open In App

Pivot Cache in Excel

Excel automatically makes a copy of the source data and saves it in the Pivot Cache when you build a PivotTable.

It is a part of the workbook and is linked to the Pivot Table, even though you can’t see it. When you make adjustments to the Pivot Table, it uses the Pivot Cache rather than the data source. Excel stores the Pivot Cache in its memory. When you create a PivotTable, adjust a Slicer selection, or switch rows/columns around, the PivotTable refers to that data in the Pivot cache.



It allows Excel to react quickly to changes in the PivotTable, but it also doubles the file size. Even if you have thousands of rows of data, a pivot table will summarize it quickly. Drag and drop things into the rows/columns etc. to change the results instantly.  To show any changes in the data collection, you must refresh the pivot table.

Drawback: The Pivot Cache is simply a copy of your source data, so it’s natural that your file size would double.



Sharing the Pivot Cache :

When you create PivotTables referencing the same source data, PivotTables in Excel 2007 and later have become more effective by reusing the same Pivot Cache. We can say that, for the pivot tables using the same source data, the pivot cache is shared automatically. 

This is advantageous because it prevents pivot cache replication, resulting in decreased memory consumption and hence the file size.

Disadvantages of shared Pivot Cache :

Using Pivot Cache:

For Using the Same Data Source, Creating Separate Caches for PivotTables Using Excel Table follow the below steps :

Choose the location for the Pivot Table & then click on OK.

Excel can consider the Excel table as a separate data source and build a separate cache after you renamed it.

How to get Count of total Pivot Table Caches in a Workbook ?

Follow the below steps to get count of total Pivot Table Caches in a Workbook:

Count of ActiveWorkbook.PivotCaches

Reducing the File Size (Increased due to pivot cache) :

Since a PivotTable saves a cached copy of your data, you can remove the original data source and the PivotTable will continue to work. This would greatly reduce the file size.

You can then also recreate your data source using your PivotTable. To do so, in the Values area of the Pivot Table, place a field & leave the other areas empty.

The cached version of the database will be built on a separate sheet if you double-click on the value that this calculates in the PivotTable. (Example: Double-click on Sum of Price/kg in our example)

You will get the sum of all the products even when you deleted the data source.

Article Tags :