How to open Excel file with more than 1 million rows

A common myth I hear very frequently is that you can’t work with more than 1 million records in Excel. Actually, the right myth should be that you can’t use more than 1,048,576 rows, since this is the number of rows on each sheet; but even this one is false.

In this post I’ll debunk this myth by creating a PivotTable from 50 million records in Excel.

To make things more interesting, I’ll import data from 20 different text files (.csv) with 2.5 million records each.

To accomplish this, I’ll use two Excel tools: Power Pivot and Power Query. Power Query is also known as ‘Get and Transform’ in Excel 2016.

For this post I’ll be using sales records with the following fields: Region, Product, Date, and Sales. The desired goal is to be able to analyze the sales performance by year and region.

If you want to follow along, please download the files from this link.

If you don’t have Power Query on your computer, you can download it from here: Power Query Download.

The process I’ll follow is:

How to open Excel file with more than 1 million rows

Data import and cleaning

As mentioned before, the data are contained in 20 text files. Therefore, the first step is to import and append the information from these files.

Note: I’ll use Excel 2016, however, the steps are the same on previous Excel versions. If you have Excel 2010/2013, go to the Power Query tab instead of the Data tab.

Step 1: Import the data into Excel using Power Query.

Go to Data New Query From File From Folder

How to open Excel file with more than 1 million rows

Click on ‘Browse’ and browse for the folder that contains the files, then click OK.

How to open Excel file with more than 1 million rows

Another option (the one I generally use), is to copy the path of the folder and paste it on the folder path box.

Once you click OK, press Edit on the next window.

How to open Excel file with more than 1 million rows

Then expand the content by clicking on the double arrow button

How to open Excel file with more than 1 million rows

Once the data is imported it will look like this:

How to open Excel file with more than 1 million rows

Step 2: Remove the headers from each file

The files will be imported with headers, so you must remove them. For this you can go to any of the columns and remove the column name from the options. For example, go to the ‘Region’ column and setup a filter to exclude the word ‘Region’.

How to open Excel file with more than 1 million rows

Step 3: Load the data into the Power Pivot Data Model.

After removing the headers, you just need to load the data into the Power Pivot Data Model. To do this go to File Close & Load To…

How to open Excel file with more than 1 million rows

On the ‘Load To’ dialog box, select ‘Only Create Connection’, then click on the checkbox ‘Add this data to the Data Model’ and click on Load.

How to open Excel file with more than 1 million rows

After you click Load, you’ll be able to use the data within Power Pivot.

Modify the Power Pivot Data Model

To make modifications to the Data Model, such as adding other columns, you can open the Power Pivot window.

To Open Power Pivot, go to the Power Pivot tab and click on Manage.

How to open Excel file with more than 1 million rows

If the Power Pivot tab is not visible follow the instructions on this link to enable it.

For this example, I’ll add a column called Year to calculate the year of the date column. To add a column, go to the rightmost column and double-click the header, then type the desired name.

How to open Excel file with more than 1 million rows

Then on the first row of the new column type the formula ‘=YEAR([Date])’ and press enter. The years will be calculated after pressing Enter.

How to open Excel file with more than 1 million rows

Important: Another way of adding the Year column is to do it in Power Query. In this way, you don’t have to open the Power Pivot window to modify the Data Model since the Year would already be part of the source data.

Creating the PivotTable

Once the Data Model is ready, you can create the PivotTable by clicking on the PivotTable button on the Home Tab of the Power Pivot Window.

How to open Excel file with more than 1 million rows

Then select the location of the PivotTable (New worksheet or Existing worksheet) and click OK.

How to open Excel file with more than 1 million rows

Once you click OK, the PivotTable Fields List will appear. In this example, drag the Region field to the Columns Area, the Year field to the Rows area, and the Sales field to the Values area.

How to open Excel file with more than 1 million rows

After these steps, you should get the following PivotTable with the Sales by Region and Year from 50 MILLION records.

How to open Excel file with more than 1 million rows

You can take this even further and create PivotChart from the existing PivotTable.

Click on any cell of within the PivotTable and go to Insert PivotChart.

How to open Excel file with more than 1 million rows

Then go to Line Line with Markers

How to open Excel file with more than 1 million rows

You should get a chart like this (After a few formatting tweaks, such as adding Axis Labels, Title, …)

How to open Excel file with more than 1 million rows

Finally, you can add visual filters (Slicers and timelines). Slicers allow you to filter by categorical fields; timelines allow you to filter dates.

Add a Slicer

To add a Slicer for the PivotChart, select the PivotChart and in the Analyze tab click on ‘Insert Slicer’.

How to open Excel file with more than 1 million rows

Select the field to be filtered (e.g. Region) and click ‘OK’.

Add a timeline

To add a Timeline for the PivotChart, select the PivotChart and in the Analyze tab click on ‘Insert Timeline’.

How to open Excel file with more than 1 million rows

Select the date field to be filtered (e.g. Date) and click ‘OK’.

Voila!

The end result should be a dynamic chart with filtering capabilities as shown below. Again, you’re dynamically visualizing millions of records.

How to open Excel file with more than 1 million rows

You can download the final file from this link.

Please share this post with other people so they can benefit as well.

If you want to get notified when new posts become available. Subscribe for free to Master Data Analysis!!

How do I open more than 1048576 rows in Excel?

Re: More than 1,048,576 rows You may split csv on several files and open them one by one. Or import into the Excel using legacy wizard, it has an option from which row to start importing.

How do I handle more than 1 million rows in Excel?

How-to handle more than million rows in Excel? You may know that Excel has a physical limit of 1 million rows (well, its 1,048,576 rows). But that doesn't mean you can't analyze more than a million rows in Excel. The trick is to use Data Model.

How do I open an Excel file that exceeds row limit?

How to open a data set that exceeds Excel's grid limits.
Open a blank workbook in Excel..
Go to the Data tab > From Text/CSV > find the file and select Import. ... .
Once loaded, Use the Field List to arrange fields in a PivotTable. ... .
You can also Sort data in a PivotTable or Filter data in a PivotTable..

Can an Excel file have more than 1 million rows?

Yes, Excel has maximum row limits! According to Microsoft Support (latest version): Excel's maximum row limit is 1,048,576. Columns are limited to 16,384. This applies to Excel for Microsoft 365, Excel 2019, Excel 2016, Excel 2013, Excel 2010, and Excel 2007.