Back to articles
BeginnerFormulas
2026-09-259 min read
#Excel#Data cleanup#Excel Tables

How to Delete Blank Rows in Excel Safely

Functions in this article

Jump to the reference pages for the Excel functions used below.

Browse library

To delete blank rows in Excel safely, check every column that belongs to the record. With your data in columns A through D, enter =COUNTA(A2:D2)=0 in a helper column, fill it down, and filter for TRUE. Inspect those rows, then delete the matching table rows or worksheet rows.

The useful distinction is between an empty row and an incomplete record. An order with a missing delivery date still contains an order. The method below keeps that record, along with formulas and spaces that make other rows look empty.

Set up a small example

Save a copy of your workbook before deleting anything. Clear existing filters and unhide rows and columns in the working copy so you can review the full list.

Suppose you have four data columns: Order ID, Customer, Item, and Quantity in A1:D1. Here's a five-row example. The worksheet row numbers below are labels for this explanation; don't type them into the data.

Worksheet rowA: Order IDB: CustomerC: ItemD: QuantityWhat this row contains
2O-101MayaNotebook2Complete record
3emptyemptyemptyemptyCompletely empty across A:D
4O-102Leoempty1Partial record
5emptyFormula =""emptyemptyFormula returning empty text
6emptyThree ordinary spacesemptyemptyText that looks empty

Leave cells marked empty genuinely empty. In B5, enter ="". In B6, press the space bar three times, then Enter. Keep case descriptions outside A:D; a label such as “Empty row” inside A3:D3 would make that row nonempty.

You can also download the blank-row example workbook to follow the same cases and compare the expected before-and-after result.

For your own list, include all columns that define a record in the check. If you have an ID in column H, checking only A:D isn't enough. Select the full list explicitly, including any gaps: blank rows can split the regions Excel detects automatically, as explained in Organizing Data Into Regions.

Flag completely empty rows with a helper column

Type EmptyRow? in E1. In E2, enter:

=COUNTA(A2:D2)=0

Copy E2 down through E6. The COUNTA function counts cells containing a value or formula. The =0 part asks whether that count is zero, giving you a TRUE or FALSE result for each row.

Helper cellExpected resultAction
E2FALSEKeep the complete record
E3TRUEDelete the empty row
E4FALSEKeep the partial record
E5FALSEKeep the formula
E6FALSEKeep the spaces for review

Only row 3 qualifies. Formatting alone doesn't supply a value, but a zero, a space, or a formula does. Microsoft explicitly documents that COUNTA includes formulas returning empty text.

Keep the helper column outside the range being counted. In this example, A2:D2 is correct; including E2 would make the formula refer to itself. If you're using an Excel Table, check that the helper fills every data row, including the empty ones.

Filter the helper and delete the matching rows

In an Excel Table

If the list isn't already a table, select A1:E6, choose Insert > Table, and confirm that the table has headers. Check the selected address before accepting it so the empty row doesn't cut the list short.

  1. Open the filter arrow in EmptyRow?, clear Select All, and select TRUE. Only the row originally numbered 3 should remain visible.
  2. Inspect A:D in that row. The helper says those four cells contain nothing; check that those are all the data columns you intended to inspect.
  3. Select a cell inside that matching table row. In Excel for Windows, choose Home > Delete > Delete Table Rows. The right-click equivalent is Delete > Table Rows.
  4. Clear the EmptyRow? filter to show the records you kept.

These are Microsoft's documented commands for deleting table rows. Choose the command for table rows deliberately. It removes a record from the table; deleting a whole worksheet row also removes cells beside the table. If nearby cells need to stay aligned with the table's records, review that arrangement first.

For several matches, you can delete one visible matching table row at a time, working upward from the bottom. Don't drag a selection across gaps in the row numbers and assume the hidden records are excluded. The single-row approach makes the deletion target explicit.

Pressing the Delete key to clear cell contents won't close the gap in the table.

In a plain range

Select the complete range A1:E6, then choose Data > Filter. Filter EmptyRow? to TRUE just as above. Microsoft documents filtering ranges and tables separately; a plain range needs its filter controls enabled.

Before deleting, inspect the entire worksheet row, including columns beyond D. The helper checks A:D only. A note, calculation, or second list farther to the right would also be deleted with that worksheet row. If you need those cells, use a table or work with a separate copy of the list instead.

Right-click the individual visible row number and choose the row deletion command. On Windows this is Delete; Excel for the web's delete options include Entire row. For several matches, repeat from the bottom upward, selecting one matching row number at a time. Clear the filter afterward. Microsoft's row-deletion guide explains the commands and how rows below move up.

Windows, Mac, and Excel for the web

The ribbon path for Delete Table Rows above follows Microsoft's Windows instructions. On Mac, use the table-row deletion command offered for a cell inside the table; don't substitute a whole-sheet-row command. Filter menus and deletion wording vary between apps.

In Excel for the web, use the filter and row context menu for a plain range, with the same whole-row check. Microsoft's desktop Go To Special > Visible cells only feature isn't available in Excel for the web, so don't rely on a Windows selection shortcut in the browser. Selecting and deleting one reviewed row at a time avoids that dependency.

When filtering one column for blanks is enough

You can skip the helper if you have a required identifier and your rule is delete every record without that identifier. Filter that column to (Blanks), review the resulting records, and use the appropriate row-deletion steps above.

That rule is broader than deleting completely empty rows. In our example, filtering Item for blanks would also show order O-102. Deleting it would discard the customer's name and quantity along with the missing item.

Use the helper when your rule is “keep the row if any data column contains something.” A blank optional field, such as a second address line, is a poor deletion test.

Why formulas and spaces can look blank

A formula returning empty text is still a formula

B5 contains ="", so its displayed result is empty. COUNTA still counts that cell, and E5 returns FALSE.

The COUNTBLANK function answers a different question. For the original row 5:

=COUNTBLANK(A5:D5)

The result is 4: three empty cells plus the formula's empty-text result. Microsoft confirms that COUNTBLANK includes empty-text formulas. Replacing the helper with =COUNTBLANK(A2:D2)=4 would therefore flag some rows that still contain formulas.

If your cleanup rule deliberately includes those rows, preview them separately and keep your original copy. Their formulas may be waiting for future input.

Spaces need a separate cleanup decision

The three spaces in B6 are text, so E6 returns FALSE. To inspect ordinary spaces in a separate cell, use:

=TRIM(B6)

This returns empty text for our three-space example. It doesn't change B6. The TRIM function removes ordinary leading and trailing spaces, but it won't remove every invisible character: Microsoft notes that TRIM alone does not remove nonbreaking spaces, including Unicode U+00A0 often found in copied web content.

Review and clean those values before deciding whether the row should go. The original helper deliberately leaves them in place.

Why Go To Special > Blanks can remove valid records

Go To Special > Blanks selects blank cells, according to Microsoft's selection-options reference. It doesn't test whether every data cell in a row is empty.

In A2:D6, C4 is blank even though order O-102 occupies the same row. If you select all blank cells and then delete their entire rows, that order is a deletion target too.

Use that shortcut only when a blank in the selected column is itself your reviewed deletion rule. For a list with optional fields, the helper gives you a whole-record check before you delete anything.

Check the result before removing the helper

After you clear the filter, the example should have four data rows instead of five:

Original rowOriginal contentsExpected result
2Order O-101Kept
3Empty A:DRemoved
4Order O-102 with a missing itemKept
5Formula ="" in BKept
6Three spaces in BKept

Row numbers change after deletion, so compare record IDs and contents with your saved copy. Check that O-101 and O-102 remain, the formula is still present, and the space-containing cell hasn't disappeared. Every remaining helper result should be FALSE.

If the result differs, use Undo immediately—Ctrl+Z in Windows—and investigate before continuing. Once the result is right, remove only the EmptyRow? helper column. If your next task is repeated records, follow the separate guide to removing duplicates in Excel.

Enjoyed this guide?

Join our newsletter to get the latest Excel tips delivered to your inbox.

You can unsubscribe anytime. See our Privacy Policy.