Alan's Blog

"Yeah. I wrote a script that will do that."

Menu
  • About My Blog
Menu

Minimize File Size Bloat with Excel Pivot Tables

Posted on November 2, 2014November 29, 2014 by Alan

I often work with very large spreadsheet, often more than 30 MB in size. I am an Office user, not an Office expert.  A few months ago one of my teammates taught me how to use pivot tables to summarize and present the large data set in a way better than just using filters.  The standard way of creating a pivot table is quite easy, but I was surprised to find that it nearly doubled the size of my files — when it worked  Often I got the error, “Excel cannot complete this task with available resources”.  I found a lot of not very helpful information, until I saw a post from someone saying he put the pivot table in a second spreadsheet, and used Microsoft Query to connect them.  This got me to thinking — why not try it within the spreadsheet itself?  And it works!  Here are the steps:

The technique below requires that you have Microsoft Query installed.  It is an optional component which you may have to add — it is under Office Tools.  Note that this also works with Pivot Charts.  The steps to create the Pivot Table are:

  • Add a or select a new sheet
  • Select Data/Get External Data/From Other Sources
  • Choose “From Microsoft Query”
  • From the database tab, select Excel, then press OK
  • Select the file you are working on.
  • Go to options, and check System Tables
  • Select page with data. Expand to select what want. You can select all
  • Click Next through filter and sort
  • Click Finish “Return Data to Microsoft Excel”
  • At Import Data, choose Pivot Table (or Pivot Chart)  Report.

You will see the data being queried as the pivot table is generated.  Unlike a standard Pivot Table, you will not have a second copy of the data as part of the document.  The new size is only slightly larger than the original document.

Leave a Reply

You must be logged in to post a comment.

Search

Please Note

All the scripts are saved as .txt files. Newer files have a “View Script” button which will let you save or open a script in notepad. For earlier posts, the easiest way to download with IE is to right click on the link and use “Save Target As”. Rename file from Name_ext.txt to Name.ext.

To see a full post after searching, please click on the title.

PowerShell Scripts were written with version 3 or later.

https connections are supported.

All new users accounts must be approved, as are comments. Please be patient.  If you find a post error or a script which doesn’t work as expected, I appreciate being notified.  My email is my first name at the domain name, and you are welcome to contact me that way.

Tags

1E ACLS Active Directory ActiveDirectory ADSI Advanced Functions Audit Change Administrator Password COMObject Computer Groups DateTime Desktop DNS Excel FileScriptingObject Forms General GPO GPS Group Policy Hacks ISE Lockout logons NAV740 Nessus OU OU permissions Outlook Pick Folder Power PowerShell Powershell Scriptlets RDP SCCM schedule reboot Scripting Security Shell.Application user information VBA Windows Update WMI WordPress WPF

Categories

akaplan.com

  • Back to Home Page

Archives

Scripting Sites

  • A Big Pile of Small Things
  • Adam, the Automator
  • Art of the DBA
  • Ashley McGlone
  • Boe Prox
  • Carlo Mancini
  • DexterPOSH
  • Doug Finke
  • Jaap Brasser's Blog
  • JeffOps The Scripting Dutchman
  • Jonathan Medd's Blog
  • Keith Hill's Blog
  • LazyWinAdmin
  • Nana Lakshmanan
  • PowerShell Magazine
  • PowerShell Team Blog
  • PowerShell.org
  • PwrShell.net
  • Richard Siddaway's Blog
  • Ryan Yates' Blog
  • Skatterbrainz
  • The Lonely Administrator

SQL Site

  • Art of the DBA

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2025 Alan's Blog | Theme by SuperbThemes

Terms and Conditions - Privacy Policy