How to Find Duplicates Beyond Excel's 1 Million Row Limit Using Power Query
Question details
The user needs a method to identify duplicate project IDs within a massive dataset of approximately 5 million rows without encountering Excel's maximum worksheet row constraints.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Analyzing and extracting duplicate records from a dataset containing 5 million rows, which is too large to fit or process directly in a standard spreadsheet.
- Observed behavior
- Excel worksheets have a hard limit of 1,048,576 rows. Attempting to load 5 million rows directly into a worksheet results in truncated data and errors, preventing standard duplicate detection methods.
Ensure your 5-million row dataset is saved as an external file, such as a CSV or database connection, so Power Query can process it without opening it in a worksheet.
Group Data in Power Query and Load to Data Model
Process the data using Power Query's internal engine to count duplicates, and then load the summarized results to the Data Model to avoid worksheet limits.
Power Query can easily process millions of rows in the background. The row limit only applies to the physical worksheet. By filtering the duplicates inside Power Query and loading the final table directly to the Data Model, you completely bypass the 1,048,576-row limitation.
Open a blank workbook, navigate to the Data tab on the ribbon, click 'Get Data', and select your data source (e.g., From Text/CSV or From Database) to import your 5-million row file.
In the Power Query Editor, click on your Project ID column to select it. Navigate to the Home tab and click 'Group By'.
In the Group By dialog, ensure your Project ID column is selected. Name the new column 'Count', set the Operation to 'Count Rows', and click OK.
Click the filter dropdown arrow on the newly created 'Count' column, select 'Number Filters', and choose 'Greater Than'. Enter 1 to keep only the IDs that appear multiple times.
Click the arrow below 'Close & Load' and select 'Close & Load To...'. In the Import Data dialog, select 'Only Create Connection' and check the box for 'Add this data to the Data Model'. Click OK.
Go to the Insert tab, select 'PivotTable', and choose 'From Data Model'. You can now place your duplicate Project IDs and their counts into the PivotTable for review.

Export Processed Data to CSV
Use Power Query to find the duplicates, then export the result out of Excel if you need a physical file of the duplicates.
Efficiently Handle Your Data with WPS Office
While processing 5 million rows requires advanced database querying, WPS Office is the perfect lightweight alternative for managing standard data, daily reporting, and comprehensive spreadsheet tasks. It is fully compatible with Microsoft Excel formats and provides an intuitive, highly responsive experience for free.
- 1. Download and Install: Visit the official WPS Office website to download the free installation package for your operating system.
- 2. Open WPS Spreadsheets: Launch the application and open your existing .xlsx or .csv files to immediately begin analyzing your data.
- 3. Leverage Built-in Tools: Use WPS Spreadsheets' robust features like PivotTables, advanced filters, and duplicate removal to manage your datasets efficiently.

Frequently Asked Questions
What is the maximum row limit in a standard Excel worksheet?
A standard Excel worksheet is strictly limited to 1,048,576 rows and 16,384 columns. You cannot paste, type, or load data exceeding this limit directly into the visible grid.
Can Power Query handle files larger than 1 million rows?
Yes. Power Query can connect to, filter, and process datasets with tens of millions of rows in its internal engine. The limitation only occurs when you attempt to output that data into the standard worksheet grid.
How do I view data that has been loaded to the Data Model?
Data in the Data Model does not appear in normal spreadsheet rows. To view or interact with it, you must insert a PivotTable or PivotChart based on the Data Model, or open the Power Pivot window from the Data tab.
Why use 'Group By' instead of 'Remove Duplicates' in Power Query?
The 'Remove Duplicates' feature deletes duplicate rows, leaving only unique values. The 'Group By' feature with a count allows you to specifically isolate and view which items are duplicated and how many times they appear in the dataset.




