Excel cannot delete a worksheet row with an IF formula alone: formulas return values, they do not remove rows. To delete rows that are completely blank, add a helper column to identify them, filter for the blank rows, and delete those rows; if a blank in one particular column is enough to mark a record for removal, you can use Go To Special instead.
What “blank” means in Excel
Before deleting anything, decide what counts as a blank row. A row may look empty but contain a space, a formula that displays an empty string, formatting, or data in a column you have not noticed. Those cases do not all behave the same way in Excel.
- Completely empty row: Every cell in the part of the sheet you care about has no value or formula. This is usually the intended meaning when cleaning a list or table.
- Blank key field: A chosen column, such as Customer ID, is empty. The rest of the row might still contain information. Removing such a row is a data decision, not simply removal of an empty line.
- Looks blank: A cell may contain spaces or a formula returning an empty string. It can appear empty on screen while still containing something Excel recognizes.
Deleting a worksheet row removes its contents and formatting across the entire row, including columns outside your visible data. If information to the right of your table matters, check the sheet before removing rows. For a table, deleting a table row removes that record from the table; it does not mean a formula has identified and erased it automatically.
Safest method: use a helper column
A helper column is the clearest choice when a row should be removed only if all the relevant cells are empty. It lets you inspect the result before deleting anything, which is useful when data includes formulas, optional fields, or occasional missing values.
- Identify the full set of columns that make up your records. For example, if each record uses columns A through F, do not include unrelated notes or calculations elsewhere on the sheet.
- Add a temporary heading in the next unused column, such as G1, called “Blank row?”
- With record data in A2:F20 and the helper formula entered in G2, use:
=SUMPRODUCT(--(LEN(A2:F2)>0))=0 - Fill the formula down alongside all records. A result of TRUE means that none of the cells in that row has a displayed text value; FALSE means at least one cell contains something.
- Turn on filters using Home > Sort & Filter > Filter, filter the helper column to TRUE, and review the visible rows. Select the visible row headers, then use Home > Delete > Delete Sheet Rows. Clear the filter and confirm the remaining records.
- Remove the temporary helper column when you are satisfied with the result.
For this example, if A2 contains Mira, B2 contains 12, and C2:F2 are empty, the formula returns FALSE: LEN counts four characters for Mira and two for 12, so the total is six, not zero. If A3:F3 are all genuinely empty, it returns TRUE. The formula treats a formula that displays an empty string as having a length of zero, but a cell containing one or more spaces has a positive length and is not marked blank.
In Microsoft 365 for Windows, the formula can be filled down by dragging the fill handle or copying it into the remaining helper cells. Filtering and deleting rows does not require a special formula feature, so this approach also works in many older desktop editions. In Excel for the web, use the available filter and row-delete controls; VBA macros are not available there.
Use Go To Special when one column defines a blank record
Go To Special can quickly select empty cells in a chosen range. It is appropriate when a blank in a specific field means the entire record should go—for example, if every legitimate row must have an invoice number in column A. It is not a safe shortcut for finding rows that are empty across several columns.
- Select only the relevant cells in the key column, excluding its heading. For example, select A2:A100 if column A contains a required ID.
- Choose Home > Find & Select > Go To Special, select Blanks, and choose OK.
- Inspect the selection and confirm that every row with a blank key should be removed.
- Choose Home > Delete > Delete Sheet Rows. Check the surrounding records afterward.
The important limitation is that this method finds blank cells in the selected range, not rows that are blank in every column. If you select A2:F100, it can select blank cells from partially completed records too. Deleting their entire rows would then remove records that still contain data. Selecting just the required key column makes the rule explicit, but it still cannot tell whether a missing ID is an error that needs fixing rather than a record to discard.
Remove blank rows from a filtered list
Filtering is useful when the deletion rule is based on one field, or when you have already identified empty rows with a helper column. Once the filter shows only rows to remove, select the visible row headers and delete sheet rows. Do not select the whole dataset and clear its contents: clearing cells leaves empty rows behind and can affect formulas or formatting differently from deleting rows.
If the data is an Excel table, use its filter dropdown to show the records that match your rule. Deleting selected table rows removes those records from the table. If you need to preserve the original order or want an easy recovery route, first save a copy or add an index column with the original row order; sorting or filtering can make it harder to reconstruct the prior arrangement.
After deletion, clear the filter and check both the first and last records. Also confirm that totals, charts, formulas, and references still point to the intended data. Excel usually adjusts many references when rows are deleted, but a review is worthwhile, especially in a workbook with linked sheets or manually defined ranges.
Power Query as a repeatable alternative
If you regularly import and clean the same kind of data, Power Query can remove blank rows as a repeatable transformation rather than permanently editing the source worksheet. Select the data and choose Data > From Table/Range to open the Power Query Editor. In the editor, choose Home > Remove Rows > Remove Blank Rows, then close and load the cleaned result.
This is useful for recurring exports because you can refresh the query when the source data changes. The query creates a cleaned output; it does not delete rows from the original source sheet. Check what Power Query considers blank in your imported columns, particularly if the source contains spaces or values that only look empty. If your actual rule is “remove records with no customer ID,” filter that specific column instead of relying on a general blank-row command.
Common problems and how to avoid them
- Rows still look empty after cleanup: They may contain spaces, formulas, or data in columns beyond the range you checked. Inspect the relevant columns and distinguish visually blank cells from truly empty ones.
- A formula cell looks blank but remains: A formula returning an empty string is still a formula. The helper formula above checks the displayed length, so it treats that result as blank; COUNTA-based checks, by contrast, count cells containing formulas.
- Valid records disappear: The selected range may have included optional fields. Use a helper that checks the entire intended record, or use Go To Special only on a required key column.
- Formatting or formulas change unexpectedly: Deleting a sheet row affects the whole worksheet row, not just the selected table columns. Review nearby data and formulas, and make a copy before bulk deletion.
- Filtered rows are confusing: Confirm that the filter displays only the rows intended for removal before selecting row headers. Clear the filter after deletion to verify that other records remain.
A reliable safeguard is to save a separate copy before a large cleanup, especially when the selection rule is new or the workbook is shared. You can also copy the rows marked TRUE to another sheet before deleting them. That creates a simple record of what the cleanup removed and makes it easier to spot a rule that was too broad.
Which method should you choose?
Choose based on the rule, not merely on which command is fastest. Use a helper column when “blank” means every relevant field is empty, because it makes the result visible and reviewable. Use Go To Special when a single required field determines whether a record belongs. Use Power Query when the cleanup needs to be repeated and the source should remain untouched.
For a one-time cleanup, deleting filtered rows is straightforward after you verify the selection. For a process that runs repeatedly, a saved query or a documented helper-column workflow is easier to audit than an unexplained deletion. If blank fields might represent valid incomplete records, do not remove them automatically; filter them for review or correct the missing information instead.
Frequently Asked Questions
Can an IF formula delete a row in Excel?
No. An IF formula can display a label such as TRUE or “Delete” when a condition is met, but formulas cannot physically remove worksheet rows. Use the result to filter rows and delete them, or use an automation tool designed for that task.
How do I delete rows that are completely blank?
Use a helper column to test the full range of cells that defines each record, filter for rows marked blank, review them, and delete the visible sheet rows. This avoids treating a missing value in one optional column as an entirely empty record.
Does Go To Special delete every blank row?
No. Go To Special selects blank cells in the range you selected. If that range spans several columns, it can find blanks in otherwise populated records. Use a single required column for a key-field rule, or a helper column to check all relevant fields.
Will Excel treat a formula returning an empty string as blank?
It can look blank, but different checks handle it differently. The helper formula in this guide uses LEN, so a formula result of an empty string has length zero. A cell containing spaces has a positive length and is treated as nonblank.
Can I remove blank rows without changing the source data?
Yes. Use Power Query to load a cleaned output while keeping the original source intact. You can refresh the query as the source changes, then review the output before using it elsewhere.
Related
- Excel Not Tabbing to Next Cell? Fixes That Work
- Media Excel Shortcuts for Images, Links, and Objects
- Average Excel File Size: What to Expect and Why It Varies
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- COUNTA Across Multiple Excel Sheets: Formulas and TipsTo count nonempty cells in the same range across consecutive worksheets, use =COUNTA(Jan:Mar!A2:A100). This assumes the Jan, Feb,…
- How to Copy a Formula Horizontally in ExcelTo copy a formula horizontally in Excel, select the cell that contains it and drag the small fill…
- How to Create Box File Labels in Word That Fit RightTo create box file labels in Word, measure the label area, set up a page or table to…
- Excel INDEX Function Examples: Useful Formulas and UsesExcel’s INDEX function returns a value—or a reference to a value—from a range based on its row and…
- Microsoft Excel SUMIF Examples and How to Use ThemIn Microsoft Excel, SUMIF adds values that meet one condition. For example, with categories in A2:A6 and amounts…
- Excel Timesheet: Calculate Hours Worked With FormulasTo calculate a shift in an Excel timesheet, put the start time in C2, end time in D2,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.