FormulaFix · Plain-English guides to Excel and Google Sheets formulas

How to Remove Blank Rows in Excel: A Step‑by‑Step Guide


Why Blank Rows Matter

Blank rows look harmless, but they can cause real problems in an Excel workbook.

Issue Typical Symptom
Misleading calculations Averages that are lower than expected
Disordered sorting Related rows split by blank lines
Cluttered PivotTables Extra “(blank)” category in rows/columns
Slower workbook performance Longer recalculation times, laggy scrolling
Import errors Destination system rejects the file or adds empty rows

Removing blank rows keeps your data clean, ensures formulas work as intended, and improves overall workbook efficiency.


1. Using Filters to Hide and Delete Blank Rows

Filtering is the quickest way to locate and purge blank rows without writing a formula. The steps are identical in Excel (Windows/macOS) and Google Sheets (menu names differ slightly).

A B C
Name Date Amount
Alice 1/5/2024 120
Bob 2/10/2024 85
Carol 3/15/2024 210

Steps

  1. Select the whole data range (including headers).
  2. Turn on the filter
  3. Excel: Data ► Filter (or Ctrl + Shift + L).
  4. Google Sheets: Data ► Create a filter.
  5. Click the dropdown arrow in any column header.
  6. Choose “Blanks” (or uncheck everything except “(Blanks)”). This hides every row that contains data and leaves only completely empty rows visible.
  7. Select the visible blank rows – click the first row number, then Shift‑click the last one.
  8. Delete the rows
  9. Excel: right‑click ► Delete Row ► Table Rows (or Ctrl + -).
  10. Google Sheets: right‑click ► Delete rows X‑Y.
  11. Clear the filter to reveal the cleaned table.

Result

A B C
Name Date Amount
Alice 1/5/2024 120
Bob 2/10/2024 85
Carol 3/15/2024 210

2. Go To Special (Excel) – Selecting and Deleting Blank Rows

The Go To Special command lets you highlight every blank cell in a selected range and delete the rows that contain them.

Steps in Excel

  1. Select the range you want to clean. To select the entire worksheet, press Ctrl + A twice.
  2. Press F5 (or Ctrl + G) → Special… → choose Blanks → OK. All blank cells are now highlighted.
  3. With the blanks still selected, press Ctrl + - → choose Entire row → OK. Excel removes every row that contained a blank cell in the original selection.

Tip: If you only want to delete rows where all cells are blank, first filter each column for blanks, then delete the visible rows.

Google Sheets Equivalent

Google Sheets does not have a built‑in “Go To Special”. You can achieve the same result with a filter (see Section 1) or with a short Apps Script:

function deleteBlankRows() {
  const sheet = SpreadsheetApp.getActiveSheet();
  const data = sheet.getDataRange().getValues();
  for (let i = data.length - 1; i >= 0; i--) {
    if (data[i].every(cell => cell === "")) {
      sheet.deleteRow(i + 1);
    }
  }
}

Running the script removes any rows that are completely empty.


3. Removing Blank Rows with a Formula

A helper column can flag rows that contain data, letting you filter or copy only the rows you need. The same formula works in modern Excel (Office 365/2021 or later) and in Google Sheets.

3.1 Create a helper column

Assume your data starts in A2 and spans columns A:C. In D2 enter:

=IF(COUNTA(A2:C2), ROW(), "")
A B C D (helper)
John 10 2023‑01‑01 2
Mary 15 2023‑01‑02 4
Tom 12 2023‑01‑03 6

Result: The formula returns the row number when at least one cell in the row is non‑blank; otherwise it returns an empty string.

3.2 Filter out the blanks

Only rows with data remain visible.

3.3 (Optional) Copy the cleaned list

Select the visible rows, copy, then paste‑special → Values to a new sheet or range. Delete the helper column if you no longer need it.

Why it works


4. Best Practices for Avoiding Blank Rows

Blank rows are usually the result of sloppy data entry or copy‑pasting from other sources. Preventing them in the first place saves time and keeps formulas, filters, and PivotTables working smoothly.

Practice Why it Helps Quick Implementation
Use Excel Tables Tables expand automatically and keep rows contiguous. Select the range → Ctrl + T.
Validate Input with Data Validation Forces users to fill required fields. Select a column → Data ► Data Validation → set criteria and tick Reject input that does not meet the criteria.
Turn off “Show blanks” in filters Prevents hidden blanks from re‑appearing after a filter is applied. In a filtered column, uncheck (Blanks).
Use Structured References Formulas like =SUM(Table1[Amount]) ignore empty rows automatically. Write formulas using the table name and column header.
Apply a “Remove Blank Rows” step in Power Query Strips blanks before data reaches the worksheet. In Power Query Editor → Home ► Remove Rows ► Remove Blank Rows.
Standardize import processes Import scripts that trim empty rows keep the sheet clean. After import, run =FILTER(A2:C100, LEN(A2:A100)>0) to drop rows where column A is empty.

Additional Tips


5. Troubleshooting Common Issues

Problem Likely Cause Quick Fix
Blank rows remain after Filter → Delete Row Cells contain spaces, non‑printing characters, or formulas returning "". Use Ctrl + H → Find a space (or the suspect character) → Replace with nothing → Re‑apply filter and delete.
Go To Special → Blanks deletes rows you need Some “blank” rows actually contain hidden values (e.g., 0 dates). Use Filter instead, so you can preview which rows will be removed.
Power Query removes rows but the output still shows blanks The “Remove Blank Rows” step is placed before an Expand or Merge step that re‑introduces blanks. Move the Remove Blank Rows step after any expanding/merging steps.
XLOOKUP or VLOOKUP returns #N/A after rows are deleted The lookup range still includes the deleted rows, causing mismatched array sizes. Convert the source data to a Table (Ctrl + T) so ranges adjust automatically, or redefine the range manually.
Google Sheets =FILTER returns an error after removing rows The filter range still contains empty rows that break array dimensions. Use =QUERY(A2:C, "select * where A is not null", 0) or wrap the range in ARRAYFORMULA.

Common Mistakes & How to Avoid Them

  1. Deleting rows instead of clearing contents – If you only need to remove the blank values but keep the row structure, use Clear Contents (Delete ► Clear Contents) rather than deleting the entire row.
  2. Running a macro on a filtered list – Deleting rows while a filter is active can skip hidden rows. Always remove the filter before running a macro that deletes rows.

FAQ

How can I delete blank rows without affecting data in other columns?

Use a filter to show only completely blank rows, then delete the visible rows. Because the filter isolates rows that are empty across all columns, no data in other columns is touched.

What is the fastest way to remove blank rows in Excel?

The quickest native method is Go To Special → Blanks → Delete → Entire row. It highlights every blank cell in one step and removes the associated rows instantly.

Can I automate the removal of blank rows using a macro?

Yes. A simple VBA macro can loop through a range from the bottom up and delete any row where all cells are empty:

Sub DeleteBlankRows()
    Dim ws As Worksheet, r As Long, lastRow As Long
    Set ws = ActiveSheet
    lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
    For r = lastRow To 1 Step -1
        If Application.WorksheetFunction.CountA(ws.Rows(r)) = 0 Then ws.Rows(r).Delete
    Next r
End Sub

The macro works in all recent versions of Excel (including Office 365) and removes rows without disturbing other data.


By following the methods and best‑practice tips above, you can keep your worksheets free of stray blank rows, ensure calculations stay accurate, and maintain optimal performance. Happy cleaning!