What happens when you delete rows while a filter is active
When you delete rows in a filtered spreadsheet, Excel deletes only the visible rows — the ones you can see on screen. The hidden rows stay in your file untouched. This is usually what you want: you filter to show only the data you need to remove, then delete just that subset. But if you forget that a filter is active, you can accidentally delete far more than you intended when you remove the filter afterward and discover rows you meant to keep are gone.
The safest approach is to check whether a filter is on before you delete anything. If the column headers have small dropdown arrows next to them, a filter is active. If you see a blue row number on the left side of the spreadsheet, that is another sign — Excel uses blue to mark filtered rows.
Key Takeaways
- Deleting rows while a filter is on removes only the visible rows, leaving hidden rows intact in your file.
- Check for dropdown arrows in the header row and blue row numbers on the left to confirm a filter is active before deleting.
- If you delete rows by mistake, use Ctrl+Z (or Cmd+Z on Mac) when ready to undo — this works even after you remove the filter.
- To delete filtered rows permanently and safely, select the visible cells, delete them, then remove the filter to confirm what remains.
The step-by-step process for deleting filtered rows
Start by explore your filter so only the rows you want to delete are visible. Click the Data tab at the top of Excel, then click Filter. Dropdown arrows will appear in your header row. Click the dropdown arrow in the column you want to filter by, uncheck the boxes next to the data you want to keep, and click OK. Now only the rows you want to delete should be visible.
Next, select all the visible rows you want to delete. Click the row number on the left side of the first row you want to remove, then hold Shift and click the row number of the last row. All the visible rows between them will highlight in blue. If the rows are not consecutive, hold Ctrl and click each row number individually instead.
Right-click on one of the selected row numbers and choose Delete Rows from the menu. Excel will remove only the visible rows. The hidden rows will remain in your spreadsheet. After you delete, click the Data tab again and click Filter to turn off the filter. All your remaining rows will reappear, and you can verify that you deleted the correct data.
Why filtering before deleting is safer than sorting
Sorting rearranges your rows but does not hide them, so if you sort and then delete, you are deleting rows in their new order — which can be confusing if your sort criteria do not match what you actually want to remove. Filtering hides the rows you do not want to touch, which makes it much harder to accidentally delete the wrong data.
Filtering also preserves your original row order. When you remove the filter, everything goes back to the way it was before, minus the rows you deleted. Sorting can scramble your data if you have multiple columns that depend on each other staying in the same order.
How to undo a deletion if you made a mistake
If you delete rows and then realize you removed the wrong data, press Ctrl+Z on Windows or Cmd+Z on Mac when ready. Excel will restore the deleted rows, even if you have already removed the filter. You can undo multiple steps in a row by pressing the keyboard shortcut repeatedly, or by clicking the Undo button (the curved arrow) in the top left corner of Excel.
Undo works best if you catch the mistake right away. If you have made many other changes to the spreadsheet since the deletion, undo will reverse all of those changes too, which may not be what you want. In that case, you may need to manually re-enter the deleted data or restore from a backup copy of the file.
Deleting entire rows versus clearing the contents
When you right-click and choose Delete Rows, Excel removes the entire row from the spreadsheet — the row numbers shift up, and the total number of rows decreases. This is permanent and cannot be undone after you save and close the file (unless you have a backup).
If you want to keep the row structure but remove only the data inside the cells, right-click instead and choose Delete Cells, then select Delete Entire Row. Alternatively, select the cells you want to clear, press Delete, and the contents will disappear but the empty rows will remain. This approach is safer if you are not sure whether you need those rows later, because you can always fill them back in.
Filtering by multiple criteria to narrow down what you delete
If your spreadsheet has many columns, you can filter by more than one column at once to make sure you are deleting exactly the right rows. Click the dropdown arrow in the first column you want to filter, uncheck the data you want to keep, and click OK. Then click the dropdown arrow in a second column and do the same. Now only rows that match both filter criteria will be visible.
This is especially useful if you are deleting rows based on a date range, a status, or a category. For example, if you have a column for "Status" and a column for "Date", you could filter to show only rows where Status is "Inactive" and Date is before January 1, 2023. That way you know you are deleting only the old, inactive records and not accidentally removing current data.
What to do if you cannot see the filter dropdown arrows
If your header row does not have dropdown arrows, the filter may not be turned on. Click any cell in your data range, then click the Data tab and click Filter. The arrows should appear. If they still do not appear, make sure your header row is actually formatted as headers — Excel needs to recognize the first row as column titles to add filter dropdowns.
If you have already applied a filter and the arrows are there but grayed out or not responding, try clicking Data and then Filter again to toggle it off and back on. If that does not work, save your file, close it, and reopen it. Sometimes Excel needs a restart to refresh the filter interface.
Frequently Asked Questions
If I delete filtered rows and then remove the filter, will the hidden rows come back?
No. Deleting rows removes them permanently from the file. The hidden rows stay hidden until you remove the filter, but they are not deleted — they are still there. Once you remove the filter, you will see all the rows that were not deleted. The deleted rows are gone for good unless you undo the deletion when ready.
Can I delete filtered rows without selecting them one by one?
Yes. After you explore your filter, click the first visible row number on the left, then hold Shift and click the last visible row number. All visible rows will select at once. Right-click and choose Delete Rows. This is much faster than clicking each row individually.
What if I delete rows by mistake and I have already saved the file?
If you saved after the deletion, undo will not work. Your best option is to close the file without saving any new changes, then reopen the last saved version. If you have made other changes you want to keep since the deletion, you may need to manually re-enter the deleted data or check whether your computer or cloud storage has an older version of the file you can restore.
Does filtering work the same way in Google Sheets as it does in Excel?
Google Sheets filtering is similar but not identical. You click Data and then Create a Filter, and the same dropdown arrows appear. Deleting rows in Google Sheets also removes only visible rows. However, Google Sheets stores version history automatically, so you can recover deleted rows by clicking File, then Version History, and selecting an earlier version of the sheet.
Can I filter and delete rows based on a formula or calculation?
You can filter based on the result of a formula if the formula is in a column. For example, if you have a column that calculates whether a value is above or below a threshold, you can filter that column to show only rows where the result is "Below" and then delete those rows. You cannot filter based on a formula that is not displayed in a cell, but you can create a helper column with a formula and filter by that instead.