Delete Rows Based On A Specific Cell Value (or Condition) in ExcelLearn how to delete rows that contain a specific cell value or meet a certain condition
When an Excel workbook or worksheet is continually worked for several months or years, it can accumulate data pretty fast.
This can often lead to bloating the worksheet.
Sometimes, unnecessary data may still exist in these sheets.
For example, a sheet may still contain data that is from 5 years ago.
This is often caused by updating the sheet without deleting unnecessary or obsolete data.
In some cases, you may just have to delete entire rows of cells that contain a specific cell value or meet a certain condition.
For example, you may want to delete rows that contain data pertaining to a particular product or salesperson.
While deleting multiple rows can always be done manually, it’s not efficient to do (especially when working with a large dataset).
Depending on the size of the dataset, you may be deleting rows for hours and hours.
Rather than manually deleting these rows, why not use the methods that I will show in this article?
That’s right! In this article, I’ll be showing you how to delete entire rows in Excel that contain a specific cell value or meet a certain condition.
Be it a particular text or number, or a numeric value that is lesser or greater than a specific number, I got you covered.
We’ll be using certain Excel features to do the job. Gone are the days of manually removing specific rows one by one.
Let’s get started.
Delete Rows that Contain a Specific Cell Value
Suppose you’re working on this dataset:
It contains the sales data for a hypothetical store. It has three salespeople, TLN, GKS, and EXC.
You are tasked to delete any data that pertains to the salesperson TLN. To do so, you may use any of the following methods.
Use the Find Feature to Delete Rows that Contain a Specific Value
Excel’s Find feature allows you to find cells that contain the value that you’re looking for.
You can access this feature via the Find & Select button.
This button can be found on the Home tab.
Click on it. It should show you several options. Select Find from among them.
Alternatively, you may press the keyboard shortcut Ctrl + F.
This will open the Find and Replace menu with the Find tab open.
In this window, there should be a textbox where you can enter the value that you want to search.
You can use this feature to delete rows that contain the value that you searched for.
How to Delete Rows that Contain a Specific Value
To use the Find feature to delete specific rows, first select the entire dataset.
Then, open the Find and Replace menu via the Find & Select button in the Home tab.
Alternatively, you may press the keyboard shortcut Ctrl + F.
In the textbox that allows you to enter the value that you want to find, enter “TLN”.
Then, press the Find All button.
This will show you a list of all the cells that contain the value “TLN”.
Select all of the cells by pressing the keyboard shortcut Ctrl + A.
You can now close the Find and Replace menu.
You should now find that the cells that contain the value “TLN” are now selected.
Right-click on any of the selected cells.
From the options that show, select Delete.
A window will pop up.
In this window, select the Entire row option.
Then, click the OK button.
You have successfully deleted the rows that contain the value “TLN”.
Filter Data to Delete Rows that Contain a Specific Value
Excel has a feature that allows you to filter your data.
There are three ways you can access this feature.
You may access it via the Sort & Filter button which can be found in the Home tab (as can be seen in the following illustration):
You may also access the Filter function via the Filter button in the Data tab.
Finally, you may press the keyboard shortcut Ctrl + Shift + L.
How to Delete Rows that Contain a Specific Value
First, select the entire dataset. We’ll be adding filters to this dataset.
To add filters, do any one of the following: (1) click the Sort & Filter Button in the Home tab, then select Filter from the options, (2) click the Filter button in the Data tab, or (3) press the keyboard shortcut Ctrl + Shift + L.
You should now see dropdown buttons next to every column header of the dataset.
These buttons are what allow you to filter the dataset.
Click the filter button next to the column Salesperson.
Then, in the filter menu, make sure that only the TLN option is checked.
Click the OK button after doing so.
Alternatively, you may enter the “TLN” value in the search bar of the filter menu.
Click the OK button after doing so.
You should now find that the sheet only shows rows that contain that TLN value in the Salesperson column.
Select all of these rows, and then right-click on any of them.
Select Delete Row from among the options.
Excel will show a message asking you if you want to “Delete entire sheet row?”.
Click the OK button to proceed.
The sheet should show no values other than the column headers.
This is because you just deleted the filtered rows.
To make the rest of the dataset appear again, just remove the filter.
You have successfully deleted the rows that contain the “TLN” value.
Delete Rows that Contain Cells that Meet a Specified Condition
Suppose you’re working with the following dataset:
It contains the scores that hypothetical students got from their most recent exam.
Suppose you want to delete the rows that contain scores that are below 50 (i.e. less than 50). To do so, you’ll be using Excel’s Filter feature.
Filter Data to Delete Rows that Contain Cells that Meet a Specified Condition
Excel has a feature that allows you to filter your data.
There are three ways you can access this feature.
You may access it via the Sort & Filter button which can be found in the Home tab (as can be seen in the following illustration):
You may also access the Filter function via the Filter button in the Data tab.
Finally, you may press the keyboard shortcut Ctrl + Shift + L.
When the column that you want to filter only contains numeric or date values, you will have the option to use Number Filters or Date Filters.
You can use these filter options to delete rows that contain cells that meet a certain condition.
How to Delete Rows that Contain Cells that Meet a Specified Condition
First, select the entire dataset.
We’ll be adding filters to this dataset.
To add filters, do any one of the following: (1) click the Sort & Filter Button in the Home tab, then select Filter from the options, (2) click the Filter button in the Data tab, or (3) press the keyboard shortcut Ctrl + Shift + L.
You should now see dropdown buttons next to every column header of the dataset.
These buttons are what allow you to filter the dataset.
Click the filter button next to the Score column.
Then, in the filter menu, select the Number Filters option.
Since you want to remove rows that have scores of less than 50, select the Less Than option.
This should open a Custom Autofilter window.
In the textbox after “is less than”, enter 50.
Then click the OK button.
Only the rows that contain a score of less than 50 should now show in the sheet.
Select all these rows.
Then, right-click on any of them.
From among the options, select Delete Row.
Excel will show a message asking you if you want to “Delete entire sheet row?”.
Click the OK button to proceed.
The sheet should show no values other than the column headers.
This is because you just deleted the filtered rows.
To make the rest of the dataset appear again, just remove the filter.
You have successfully deleted the rows that contain a score of less than 50.
Conclusion
And those are the ways you can delete rows based on a specific value or condition.
You can use Excel’s Find and Filter features to do such feat.
Do note that doing so will delete the entire row (including any data that is outside of the dataset).
I hope that you’re able to use your learnings here in your future endeavors.