This Data Set Is Too Large for the Grid: The Excel Row Limit and What to Do
An Excel worksheet holds 1,048,576 rows and 16,384 columns. Those are 2^20 and 2^14, chosen when the file format was rewritten for Excel 2007, and they have not moved since. When a file has more rows than that, Excel tells you that the data set is too large for the grid and offers you a partial load.
What you do first: find out whether anything was actually lost, because a truncated file that looks complete is a much bigger problem than a warning message.
The short version. If your row count is exactly 1,048,576, you are not looking at all your data.
Check whether you lost rows
- Press Ctrl+End. If the cursor lands on row 1,048,576, treat the file as truncated until proved otherwise.
- Count the source rows without opening it. In PowerShell:
(Get-Content big.csv | Measure-Object -Line).Lines. On a very large file,Get-Content -ReadCount 10000is faster. - Compare that count, minus one for the header, with what landed in the sheet.
- Check the last date or ID in the sheet against the last one in the file. A truncated extract usually stops mid-period, which is the tell in any report built on top of it.
The four routes out
| Route | Effort | Use when |
|---|---|---|
| Aggregate before it reaches Excel | Low | You need totals, not rows. Most cases. |
| Power Query to the Data Model | Low | Staying in Excel, need a pivot over everything |
| DuckDB or SQLite | Medium | Repeated questions, joins, real filtering |
| pandas or Polars | Medium | It is a step in a pipeline you will re-run |
Aggregate first
The honest question is usually not about three million rows. It is about a few hundred summary rows. If the file comes from a system with an export screen, change the export to group by month and category before it lands. That solves the problem permanently and is the option people skip because it means asking somebody.
Power Query to the Data Model
Data, Get Data, From File, From Text/CSV, then Load To and choose Only Create Connection with Add this data to the Data Model ticked. The rows never touch a worksheet, so the million row limit does not apply. Build a PivotTable on the model and Excel aggregates over the whole file.
Two things to know. The model is compressed in memory, so a file that is 2GB on disk may hold in a few hundred megabytes, but 32-bit Excel will still run out at about 2GB of address space regardless. And the grid limit still applies to anything you drill through to.
Query the file where it sits
DuckDB reads a CSV directly with SQL and no import step:
SELECT region, COUNT(*) AS rows, SUM(amount) AS total
FROM 'big.csv'
GROUP BY region
ORDER BY total DESC;
That returns a handful of rows you can paste into Excel. Setup takes minutes and is covered in setting up DuckDB. For anything you will ask more than twice, load it into SQLite instead and keep it.
The column limit, and the reason you hit it
16,384 columns sounds unreachable, and it gets hit by exactly one thing: pivoting a long table wide on a field with too many values. One column per customer, or per day over several years. That is a sign the shape is wrong rather than the limit being tight. Keep the data long and let the pivot do the widening at read time.
Other limits worth knowing before you meet them
| Limit | Value | Where it bites |
|---|---|---|
| Rows per sheet | 1,048,576 | Raw extracts |
| Columns per sheet | 16,384 | Over-pivoted tables |
| Characters in a cell | 32,767 | Free-text notes, JSON blobs |
| Characters shown in a cell | 1,024 | Text that looks cut off but is not |
| Digits of precision | 15 | Long IDs turning into 1.23457E+17 |
| Selected pivot fields | 16,384 items | Very high cardinality pivots |
The 15 digit one catches people constantly: paste a 16 digit account number into a General cell and the last digit becomes zero, permanently. Format the column as Text before pasting, the same defence as in leading zeros on CSV import.
How to apply this to your own work
- Add a row count to every workbook that starts from an import, and compare it to the source count. One cell, one habit.
- When a file gets close to a million rows, stop opening it in Excel at all, even once.
- Ask the system owner for an aggregated export before you build anything clever.
- Learn the Data Model route once. It is fifteen minutes and it removes the limit for most reporting work.
- Format ID columns as Text before any paste, and check the last digits of a few of them afterwards.
The one habit to keep
Never trust a row count you did not compute. The count is the cheapest check in analysis and it catches truncation, duplicated joins and failed filters, all of which look perfectly fine on screen.
Does the workbook you rely on most say anywhere how many rows it started with?
Excel for Analysts is 378 pages that read every formula and dialog one at a time, so the workbook stops being a place where numbers appear and becomes one you can check.
Excel for Analysts, $19 →Handling large datasets works a two gigabyte file end to end, setting up a SQL database gets a CSV into SQLite in about ten minutes, and DuckDB queries the file where it sits.
Read Handling Large Datasets →