How to Remove Pivot Cache in Excel

Cody Schneider8 min read

Ever create a pivot table from a large dataset, delete the original data to shrink the file, and watch in confusion as the file size barely budges? The culprit is a hidden feature called the Pivot Cache. This article will walk you through what it is, why it makes your files so big, and exactly how to clear it so you can get back to having lightweight, easy-to-share workbooks.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

What Is Pivot Cache (and Why Should You Care)?

Think of Pivot Cache as a special memory bank that Excel creates for each pivot table. When you build a pivot table, Excel takes a snapshot of your source data and stores a complete, optimized copy of it in this cache. This is what makes pivot tables incredibly fast. When you drag and drop fields, apply filters, or add a slicer, Excel isn't re-reading your entire source spreadsheet every single time. Instead, it’s pulling from this high-speed cache.

The speed is amazing, but it comes at a cost: file size. The cache is essentially a duplicate of your source data, living inside your file. If you have 50 MB of raw data, your pivot cache will be roughly that same size, instantly doubling the impact on your workbook’s total size. This leads to a few common problems:

  • Bloated Files: Storing a full copy of the data can turn a manageable file into a huge one that's slow to open, save, and send over email.
  • "Phantom Data": This is the most confusing part. Even if you delete the original source data sheet, the pivot cache remains in the file. Excel holds onto that snapshot so the pivot table doesn't break. This is why deleting the source data often does very little to reduce the file size.
  • Outdated Information Junk: If you remove columns from your source data, the old columns can sometimes linger in the cache, especially if you had them filtered. This can lead to “items that no longer exist” showing up in your filter dropdowns.

When to Keep the Cache vs. When to Clear It

Not all caches are bad. If you're actively analyzing data and need the speed of filters and slicers, the cache is your best friend. But once you’re done with the active analysis and either need to archive the file, send it to a colleague, or simply present a static report, clearing the cache becomes a critical step in file management.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Is Pivot Cache the Reason Your File is So Big?

Before you start diving into the methods for removal, it’s good to confirm the cache is actually the problem. Here’s a quick test you can run:

  1. Save a copy of your workbook. Give it a name like "MyReport-CacheTest.xlsx."
  2. Open the new copy and navigate to the sheet containing the original source data for your pivot table.
  3. Right-click the sheet tab and select "Delete." Confirm any warnings.
  4. Now, save the file.
  5. Compare the file size of this new version with the original.

If the file size dropped dramatically, then the source data itself was the largest component. If the file size barely changed, you've just confirmed you have "phantom data" — a massive pivot cache is attached to your seemingly empty pivot table.

4 Ways to Clear the Pivot Cache in Excel

Once you’ve decided to clear the cache, you have several options depending on whether you want to preserve the pivot table itself or just its results. Here are four effective methods, starting with the simplest.

Method 1: The Quick and Dirty (Copy/Paste as Values)

This is the easiest and most common method. It's perfect for when you've finished your analysis and just need to share the final report without any of the interactivity (or the extra file size).

Steps:

  1. Click anywhere inside your completed pivot table to ensure it’s active.
  2. Select the entire pivot table. A quick way to do this is to go to the PivotTable Analyze tab, click on Actions, then Select, and choose Entire PivotTable. Alternatively, you can typically use the shortcut Ctrl + A.
  3. Copy the selected data (Ctrl + C).
  4. Right-click on a new, blank spot in your workbook (or a new sheet), and under Paste Options, select Values. The keyboard shortcut is often Alt + E + S + V.
  5. You now have a clean, static table of your results. You can safely delete the original pivot table and all its associated cache baggage.

Best for: Creating static final reports and sharing just the numbers, not the entire interactive setup.

Limitation: You lose all pivot table functionality. It’s a one-way street.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Method 2: Change the Data Source to an Empty Cell

What if you want to keep the pivot table's formatting and layout but just flush out the data? This clever technique tricks Excel into clearing the cache by pointing it to an empty data source.

Steps:

  1. Click inside your pivot table.
  2. Go to the PivotTable Analyze tab on the ribbon.
  3. Click the Change Data Source button.
  4. In the dialog box that appears, delete the existing data range and select a single, blank cell anywhere in your workbook.
  5. Click OK. Your pivot table will appear empty.
  6. Now, right-click inside the empty pivot table area and hit Refresh. This forces the pivot cache to dump its old data and load the new source... which is nothing. The cache is now empty and tiny.
  7. Save your file. You should see a massive reduction in size.

Best for: When you want to save the pivot table's structure for later use but need to send a lightweight version of the file now.

Limitation: The pivot table is unusable until you point it back to a valid data source.

Method 3: Untick a Built-in Excel Option

Excel has a built-in feature to prevent the pivot cache from being saved with the file. This is best used as a preventative measure, but you can also use it to clear an existing cache.

Steps:

  1. Right-click anywhere inside your pivot table and select PivotTable Options...
  2. Click on the Data tab.
  3. Under the "PivotTable Data" section, uncheck the box that says "Save source data with file."
  4. Next, set the "Number of items to retain per field" dropdown to None. This helps clear out old, unused filter items.
  5. Click OK.
  6. To finalize the change and purge the cache, you must now Refresh the pivot table. Right-click it and select Refresh.

When you save, the file will no longer contain the heavy cache. Each time you open the workbook, it will need to re-read the source data to populate the pivot table, which may cause a slight delay, but your file size will remain small.

Best for: A good default practice for any pivot table where the source data lives within the same workbook and file size is a consistent concern.

Limitation: You have to remember to do this for each pivot table you create.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Method 4: Automate It with a Simple VBA Macro

If you work with numerous pivot tables across many files, changing the setting one by one is a chore. A simple bit of VBA code can set all pivot tables in a workbook to dump their cache upon the next refresh.

Don't worry if you've never used VBA, this is as simple as copy and paste.

Steps:

  1. Open your Excel file. Press Alt + F11 to open the VBA Editor.
  2. In the editor, go to Insert > Module. A blank code window will appear.
  3. Copy and paste the following code into the module window:
Sub ClearAllPivotCaches()

  Dim myCache As PivotCache

  ' Loop through every pivot cache in the open workbook
  For Each myCache In ThisWorkbook.PivotCaches
    ' Sets the cache to not save source data with the file
    myCache.SaveData = False
  Next myCache
  
  MsgBox "All pivot caches are now set to not save source data."

End Sub
  1. Close the VBA Editor (you can just click the 'X').
  2. To run the macro, press Alt + F8, select "ClearAllPivotCaches" from the list, and click Run. A message box will confirm it worked.
  3. Finally, refresh all your pivot tables (you can go to Data > Refresh All) and save the workbook.

Your file size should shrink dramatically. Note that you may need to save the file as a Macro-Enabled Workbook (.xlsm) to keep the macro.

Best for: Power users and anyone responsible for preparing large reports with dozens of pivot tables.

Limitation: Can feel intimidating for beginners, and requires saving the file in a different format.

Final Thoughts

Managing pivot caches might seem like a small detail, but it’s a critical piece of good Excel hygiene. By understanding what the cache is and knowing how to clear it using methods like pasting as values or changing the data source, you can keep your files lean, responsive, and easy to share. A smaller file is a happier file for both you and your colleagues.

While mastering these tricks is valuable for Excel-based workflows, it also highlights the manual tinkering that often comes with spreadsheet reporting. It's exactly this type of tedious, time-consuming busy work - like managing file sizes or manually downloading and connecting CSVs - that we built Graphed to eliminate. Instead of worrying about caches and data wrangling, you can connect your sources once and use plain English to get real-time, interactive dashboards that update automatically, freeing you up to focus on the insights, not the technical upkeep.

Related Articles