"This data set is too large for the Excel grid": what it means and what to do

You open a CSV export — transactions, a ledger dump, a log — and Excel stops you with a warning: "This data set is too large for the Excel grid. If you save this workbook, you'll lose data that wasn't loaded." The file did open, but part of it is missing from the sheet. This guide explains what happened, how to make sure you lose nothing, and four ways to work with the whole file.

Quick answer: the file has more than 1,048,576 rows or 16,384 columns, and Excel loaded only what fits on one worksheet. Your file is intact as long as you don't save over it. Close the workbook without saving, then import the file through Data › From Text/CSV › Load To › PivotTable Report: the PivotTable works with every row.

What the warning means

A worksheet is a grid of a fixed size. Excel cannot add row 1,048,577, whatever the size of your computer's memory:

File formatRows per sheetColumns per sheet
.xlsx, .xlsm, .xlsb1,048,57616,384 (the last column is XFD)
.xls (Excel 97–2003)65,536256 (the last column is IV)

A text or CSV file has no such limit — it is as long as the system that produced it made it. When you open one that is longer or wider than the grid, Excel fills the sheet up to the last row and column and leaves the rest out. The header counts as a row, so a file with a header and 1,048,576 records is already one line too long.

The limits are listed in Microsoft's Excel specifications and limits. No setting raises them, and they are the same in every current version of Excel.

First: don't save

Opening the file changes nothing on disk. The danger is the next step: if you press Ctrl+S, Excel writes back only the rows and columns it loaded, and the rest of the file is gone.

Careful: close the workbook without saving. If you need to keep the part that did load, use File › Save a Copy and give the copy a name that says what it is — for example ledger-first-1048576-rows.xlsx — so nobody later takes it for the full data set.

If the file has already been saved over, the missing rows cannot be recovered from it. Export the data again from the source system, or restore an earlier version: files stored in OneDrive or SharePoint keep a version history, and a backup may hold the original.

Check how big the file really is

Before choosing a fix, find out by how much the file exceeds the limit. Two quick checks:

  • In Excel. Press Ctrl+End in the workbook that showed the warning. If the selection lands on row 1,048,576, the rows were cut off. Microsoft also suggests selecting a whole column and reading the count in the status bar to compare it with the source.
  • Without Excel. In Windows PowerShell, this line counts the lines of a file without loading it into memory. In our test, a 58 MB file with 2.3 million lines took about two seconds:
$n = 0; foreach ($line in [System.IO.File]::ReadLines("C:\data\export.csv")) { $n++ }; $n

The number includes the header line. If it is only slightly above 1,048,576, filtering out a few old periods may be enough. If it is several million, plan for a PivotTable or a database from the start.

Way 1. Analyze the whole file with a PivotTable

This is the method Microsoft recommends in its article on what to do if a data set is too large for the Excel grid. Power Query reads the file, and the PivotTable summarizes all of it. The steps are for Excel for Windows:

  1. Open a blank workbook — don't double-click the CSV file.
  2. On the Data tab, in the Get & Transform Data group, click From Text/CSV.
  3. Select the file and click Import.
  4. In the preview window, click the arrow next to Load and choose Load To.
  5. Select PivotTable Report and click OK.
  6. Build the report in the field list: for example, accounts in rows, months in columns, the sum of amounts in values.

The individual rows are not shown on any sheet, but totals, counts and filters in the PivotTable cover the complete file. To check that everything arrived, add any field to Values, set it to Count and compare the number with the line count from the previous step, minus the header.

In the same dialog you can tick Add this data to the Data Model. The Data Model is Excel's in-memory store behind Power Pivot; use it when you need to relate several tables or write measures. According to Microsoft's Data Model limits, one table holds up to 1,999,999,997 rows. The practical limit is memory: 32-bit Excel shares 2 GB of address space between the workbook, the model and add-ins, while 64-bit Excel has no hard limit on file size.

Excel for Mac has no Data Model; there, cutting the file down in Power Query (way 2) is the practical route.

Way 2. Load only the rows you need

Often you don't need all the rows on a sheet — only one year, one entity or one account range. Power Query can cut the file down before anything reaches the grid:

  1. Data › From Text/CSV, select the file, click Import.
  2. In the preview window, click Transform Data. The Power Query Editor opens.
  3. Filter the rows with the arrows in the column headers, remove the columns you don't need, or use Group By to sum the detail up to the level you report on.
  4. Click Close & Load. The result goes to a worksheet table.

The result must fit into 1,048,576 rows, so check the row count the query reports. The query stays in the workbook: when a new export arrives under the same name, Data › Refresh All repeats the same steps.

Way 3. Split the file into parts

If you need to see the raw rows — to look for one transaction or to hand a part to a colleague — split the file into pieces that fit. This PowerShell script writes parts of one million data rows each and repeats the header in every part:

$src  = "C:\data\export.csv"   # the big file
$rows = 1000000                # data rows per part
$reader = [System.IO.File]::OpenText($src)
$header = $reader.ReadLine()
$part = 0; $n = $rows; $writer = $null
while (($line = $reader.ReadLine()) -ne $null) {
  if ($n -ge $rows) {
    if ($writer) { $writer.Close() }
    $part++
    $writer = [System.IO.File]::CreateText(($src -replace '\.csv$', "-part$part.csv"))
    $writer.WriteLine($header); $n = 0
  }
  $writer.WriteLine($line); $n++
}
if ($writer) { $writer.Close() }; $reader.Close()

The original file is only read, never changed; the parts appear next to it as export-part1.csv, export-part2.csv and so on. Two limits: the script expects UTF-8 text, and it treats every line as one record, so a file with line breaks inside quoted fields would be cut in the wrong place.

Splitting is the weakest option for analysis: a total across the parts has to be added up by hand, and a formula cannot look from one part into another.

Way 4. Use a tool built for the size

When files of several million rows arrive every month, the grid is the wrong place for them:

  • Power BI Desktop uses the same Power Query and the same in-memory engine as Excel's Data Model, without a worksheet in between.
  • A database — Access, SQL Server, SQLite or another one your IT team supports — stores the detail, and Excel connects to it through Data › Get Data and pulls only the summary.
  • Ask for a smaller export. The cheapest fix is often at the source: one file per month instead of one per year, or totals by account instead of single transactions.

Which way when

You needUse
Totals and breakdowns over the whole fileWay 1 — PivotTable from Power Query
Several large tables related to each otherWay 1 with the Data Model
One period, entity or account range on a sheetWay 2 — filter in Power Query, then load
The raw rows, to search or to pass onWay 3 — split the file
The same oversized export every monthWay 4 — Power BI, a database, or a smaller export

If there are too many columns, not rows

More than 16,384 columns is rare and usually means the data is laid out sideways: one column per date, per sensor or per product instead of one row per record. Excel's own tools help little here. Ask the source system for a "long" export — one row per record, with the date or the item in a column of its own — and the same data turns into many rows and few columns, which the ways above can handle.

After the import: keep the workbook light

Bringing a million rows into Excel solves one problem and often starts another. The workbook grows to tens of megabytes, takes a minute to save and recalculates on every keystroke. The usual reasons are formulas copied down the full length of the data, formatting applied to whole columns, and volatile functions that force everything to recalculate. Two guides go through the causes and the fixes: why an Excel file is so large and why Excel is slow to calculate.

No add-in raises Excel's row limit, and Jumpcel doesn't either. What it helps with is the step after: its Model optimization scans the workbook and shows what makes the file large and slow — unused names and styles, formatting beyond the data, hidden objects, volatile functions — and cleans a copy, never the original.

Animation: the Model optimization window lists findings by section, Clean selected saves a cleaned copy and shows the file size before and after
Model optimization: findings by section, safe ones ticked in advance. Clean selected works in a copy and shows the size before and after.

Why analysts use Jumpcel

Jumpcel is made by BIG4 and IB financial modelling professionals for building, reviewing and taking over models.

See what makes a file heavy

One window lists the causes for the whole workbook: unused names and styles, formatting beyond the data, hidden objects and volatile functions.

Your original stays untouched

Cleaning is done in a copy of the file, and the result is shown before and after, so you can compare before you switch.

Safe for confidential data

No network connections: workbooks never leave your computer and the license is checked offline. A compiled add-in, not VBA — no macros to enable.

Ready in a minute

Installs into your user profile without administrator rights. Excel 2016, 2019, 2021 and Microsoft 365 for Windows. Free for 14 days with every feature.

Questions and answers

What does "This data set is too large for the Excel grid" mean?

The text or CSV file you opened has more rows or columns than one worksheet can hold: 1,048,576 rows by 16,384 columns. Excel loaded the part that fits and left the rest out. The file on disk is still complete.

Did I lose data when Excel showed this warning?

No. Opening the file does not change it. Data is lost only if you save the workbook over the original file: Excel then writes back just the rows and columns it loaded. Close without saving, or use File › Save a Copy with a different name.

Can I increase the row limit in Excel?

No. 1,048,576 rows by 16,384 columns is fixed for every worksheet, and no setting or edition of Excel raises it. To work with more rows, load the file through Power Query into a PivotTable or the Data Model, which holds up to 1,999,999,997 rows per table.

How do I open a CSV file with more than a million rows in Excel?

In Excel for Windows, open a blank workbook, go to Data › From Text/CSV, select the file and click Import. In the preview, click the arrow next to Load, choose Load To and select PivotTable Report. The PivotTable works with every row of the file, even though the rows themselves are not shown on a sheet.

I already saved the file. Can I get the missing rows back?

Not from the saved file: the rows that were not loaded are no longer in it. Export the data again from the system it came from, or restore an earlier version of the file from version history in OneDrive or SharePoint, or from a backup.

Find what makes your workbook heavy

Jumpcel is free for 14 days, with every feature included.