How to Reduce a Large Excel File - TurboFuture - Technology
Updated date:

How to Reduce a Large Excel File

Kevin is a Software Developer with 20 years experience designing and building business intelligence and system integration solutions.

how-to-reduce-a-large-excel-file-compact-shrink

Excel 2013 and earlier versions like Excel 2007 and 2010 or later versions like 2016 is a great tool for data analysis but can grow in size quickly. Another problem is when you are connected to a database and you reduce the size of a query in the database view; the reduction in data is not reflected in Excel as the latter keeps an internal table of the data, especially when working with Pivot Tables that are linked to the database.

There are several techniques that you can use to reduce the size of an overbloated Excel file that I will review in this reference article.

Reducing Worksheets


Excel copies and stores data for each worksheet that is created in an Excel workbook. Even if you use external data from another spreadsheet or database, each sheet will have a copy of the data. You should review the different worksheets in a workbook to see if some can be deleted or combined to reduce space.

Eliminating excess worksheet, thus data bloat, will greatly reduce the size of your file and increase performance. Also be careful about links to other worksheets with a lot of formulas or to other worksheets in external workbooks. While this won't necessarily change the size of the workbook, it will impact performance which can be as problematic as bloated data.

Figure 1 : Perform a Save As

Figure 1 : Perform a Save As

Converting to Binary


Another technique that can substantially reduce the size can be used in conjunction the previous technique of consolidating and deleting old worksheets is to convert the Excel file to a binary format which is represented by the file extension xlsb. You won’t lose any functionality and you will actually gain some performance.

To convert a 2007, 2010, 2013, 2016 or greater Excel file to a binary format, follow these simple steps.

  • With the Excel file open
  • Click on the File tab (Fig 1)
  • Select “Save AS” from the Tab menu
  • In the Save As dialog select the “Save As Type” dropdown field and select the “Excel Binary Workbook (*.xlsb)” option from the list of values. See figure 2.
  • Click Save


You'll notice a huge size file savings and an increase in performance by using the binary format. However, the trade off you won’t have access to the XML files in the Xlsx archive. See Figure 3.

Figure 2 : Save As Excel Binary Format (*.xlsb)

Figure 2 : Save As Excel Binary Format (*.xlsb)

Figure 3 : Binary versus XML File Size Example

Figure 3 : Binary versus XML File Size Example

Compacting Excel File


While not directly related to Excel, Windows has a feature that will compact the size of a file, including Excel.

To compact your Excel file, locate the your file via Windows Explorer

  • Right click the file
  • Select Properties from the context menu
  • Next Select the Advanced button (see Figure 4 below)
  • Finally select “ compress contents to save disk space...”
Figure 4: Configuring File Compress in Windows

Figure 4: Configuring File Compress in Windows

Storing the data in PowerQuery

A feature that was introduced in Excel 2007 is the PowerPivot and eventually the PowerQuery. With 2007 and 2010 versions of Excel, you can/could download a free download software/plugin for Excel that is called PowerPivot. In 2013, this technology become integrated in Excel and as of Excel 2016, it is called Get & Transform.

Where you can store up to 1 millions rows in a worksheet in Excel 2007 or 2010 (I wouldn't advise you tor try otherwise you will start getting "no resources available..." error messages), it was and still is unpractical because of performance degradation, instead you can store you data in PowerPivot which can easily handle up to 100 million rows without breaking a sweat. PowerPivot uses an API to create a tabular dataset the same way that SQL Server Analysis Services uses Tabular Data Models instead of OLAP and Power BI as well.

You import the data into PowerPivot the same way you do with Excel. You can also use DAX and PowerQuery Language to transform your data before using it in Excel. Once you data is ready, click on the Excel button in the PowerPivot menu and return to Excel. You data will be visible in Excel and you can work with like any other data in in Excel, except that data will actually in the PowerPivot and you will be accessing the data via a MetaData API. This is very powerful for data wrangling and data analysis.

In Summary

These techniques can be used separately or together to help you reduce the file size of your Excel files.

Extra Tips

For extra tips for working with large data sets in Excel, read my latest article:

  • 10 Tips for Working With Large Excel Files
    In our world of advanced analytics and big data, there is no getting away from our beloved data crunching and wrangling tool: Excel. However, with large datasets, Excel starts to huff and puff. These 10 tips will help crunch your data for the last mi

This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.

Comments

Kevin Languedoc (author) from Canada on September 02, 2020:

Hi Varma,

Please try these options, you may have a formula or a link workbook that is performing calculations in the background:

https://turbofuture.com/computers/10-Tips-for-Work...

Varma on September 02, 2020:

I have problem with just 1.5MB excel file. It tooks mare than 15minutes to open or save or save as. Please help me to sort out this issue.

Options I have tried:

1. save as into .xlsb

2. copy/move sheet tabs into another new excel.

senthil on February 02, 2020:

thank u good

Abu Jasim Mollah on February 05, 2019:

Thanks a lot Kevin. It solved my problem.

Ajith on January 29, 2019:

Thank you Kevin . It is very helpful

NOUFAL on January 12, 2019:

THANKS

Gias Mrc on November 03, 2018:

Thanks... excellent idea....!!

Anas A.khan on September 27, 2018:

Thanks ): very productive.

azarrr on August 30, 2018:

superb excellent

KALAI SELVAN on August 30, 2018:

AMAZING EXPERINCE... THANKS A LOT

sonia on August 14, 2018:

Thanks.Awesome idea

Tuhin on October 17, 2017:

I have 150 mb size excel file. After converting xlsb the file size converted in 95 mb. I want to more reduce the size of the file. Is that possible?

ALI HAIDER on July 19, 2017:

Gr8 !!I have 29 MB of file size(XLSB) how to compress into 6MB of file.its a amazing experience.Thanks..

tyatith on February 24, 2016:

i have try but still bloating file not reduce, but i notice if i use the file more often the size of file bigger and can't reduce, not like Access file which have option to compact size when close, so the file not so much increase.

excel file on October 26, 2015:

I have 13 mb of file size(XLSB) how to compress into 4mb of file

Kevin Languedoc (author) from Canada on November 23, 2013:

You should be able to do that my converting your file to a binary format (xlsb). Because the standard xlsx is simply an archive of XML documents. Also you need to keep in mid that Excel makes a copy of you data in each sheet that you create. You could also try creating the pivot table in the same sheet (if possible) or create a new workbook and use your original workbook as a data source.

cat on November 18, 2013:

My excel file is 207mb i would like to copy out my database to a new sheet to do pivot table but it keep prompting me the message;

Excel cannot complete this task with the available resources. Choose less data or close other applications.

The problem is i have close all other applications it still can't

Kevin Languedoc (author) from Canada on August 02, 2012:

Thanks. I am working on new Excel topics. Anything you would like to read in particular?

smga22 from Dhaka, Bangladesh on August 02, 2012:

Excellent Hub. Looking forward to get more from you.