Excel Performance Problems

How to Delete Excel Rows Containing a Specific Value (-9999)

Steven ParkerSteven Parker Nov 10, 2026 869 views

Question details

The user needs to efficiently remove all rows containing the missing-data marker "-9999" from a massive Excel dataset without checking them manually.

How to Delete Excel Rows Containing -9999 in Large Datasets
Product
Excel
Device & OS
not provided
Scenario
Cleaning up a large dataset by removing rows with specific missing-data placeholders (-9999).
Observed behavior
Manually checking over 100,000 rows is inefficient and impractical, requiring an automated or bulk deletion method to handle the heavy workload.
Before you start

Before modifying large datasets, always create a backup copy of your workbook to prevent accidental data loss in case of an error during the bulk deletion process.

Solution 1Recommended

Use a Helper Column and Filter Method

This is the safest and most accessible method for users. It uses a formula to flag rows containing the target value and deletes them in bulk using filters.

By creating a helper column, you can use Excel's built-in formulas to evaluate every cell in a row simultaneously. This method avoids the need for complex programming while handling large volumes of data efficiently.

1
Add a Helper Formula

Add a new helper column at the end of your dataset. Enter the formula =ISNUMBER(MATCH(-9999,B2:HE2,0)) in the first row of the data. Adjust the range 'B2:HE2' to match the actual data columns you want to search.

2
Apply Formula to All Rows

Double-click the fill handle (the small square at the bottom-right corner of the cell) or drag it down to apply the formula to all 100,000+ rows.

3
Filter the Data

Select the header row, go to the 'Data' tab on the ribbon, and click 'Filter'. Click the filter dropdown arrow on your new helper column and check only the box for 'TRUE'.

4
Delete Filtered Rows

Select all the visible rows containing the data, right-click the row numbers on the left, and choose 'Delete Row'. Finally, clear the filter from the Data tab and delete the helper column.

Use a Helper Column and Filter Method
Data Cleanup Alternative

Clean Up Large Datasets Fast with WPS Spreadsheet

WPS Spreadsheet is fully equipped to handle large datasets seamlessly, offering robust formula support, advanced filtering, and VBA macro compatibility to clean up your data efficiently.

  1. 1. Open Your File: Launch WPS Spreadsheet and open your large dataset.
  2. 2. Add the Formula: Insert the helper formula =ISNUMBER(MATCH(-9999, A2:Z2, 0)) in a new column and drag it down.
  3. 3. Filter the Data: Use the Filter tool under the Data tab to display only the 'TRUE' values.
  4. 4. Delete and Save: Highlight the visible rows, right-click, select 'Delete', and save your cleaned document.
Easily process large datasets with over 100,000 rows without application lag.Full compatibility with Microsoft Excel formats (.xlsx, .xls) and macro-enabled files (.xlsm).Built-in advanced filtering and sorting tools to streamline complex data cleanup.Completely free to download and use with a highly intuitive, tabbed interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel freeze when I delete thousands of rows at once?

Excel might freeze or take a long time because it recalculates formulas and updates the screen graphics for every single row being deleted. Setting calculation to 'Manual' and turning off 'Screen Updating' before the deletion can significantly improve performance.

Does the MATCH formula work if the value -9999 is part of a text string?

No, the standard MATCH formula looks for exact cell value matches. If '-9999' is embedded within other text in a cell (e.g., 'Error code -9999'), you should use a wildcard search with the SEARCH function combined with ISNUMBER instead.

Can I use the Sort feature instead of filtering to delete the rows?

Yes. After creating the helper column that outputs TRUE or FALSE, you can select your entire dataset and Sort by the helper column. All the TRUE rows will group together, allowing you to highlight them all at once and delete them quickly.