DataTools AI DataTools AI

How to remove blank rows in Google Sheets

Blank rows sneak in when you paste data from several places, export from a CRM or delete records by hand. They break pivot tables and charts, make "Select all data" stop halfway and leave gaps in mail merges. The examples below assume your data is in columns A to D with headers in row 1.

En español: cómo eliminar filas vacías en Google Sheets.

Before you start: decide what "blank" means

A row is only safe to delete if every column is empty. If you look at a single column, you can delete rows that have a missing email but still contain a name and a phone number. To mark fully empty rows, add a helper column E with:
=LEN(A2&B2&C2&D2)=0
It returns TRUE only when all four cells are empty. Fill it down, and make a copy of the tab first (right-click the tab → Duplicate) so you can compare afterwards.

Step 1: filter, then delete the rows

  1. Select your data and use Data → Create a filter.
  2. Click the filter icon on the helper column, choose Filter by values, click Clear and tick only TRUE. (Without a helper column you can filter one column by (Blanks), but then only that column is checked.)
  3. Select the visible row numbers, right-click and choose Delete selected rows. With a filter on, only the visible rows are deleted.
  4. Remove the filter (Data → Remove filter) and delete the helper column.

Step 2: sort to push blank rows to the bottom

Google Sheets always sorts empty cells to the end, whether you sort A→Z or Z→A. Select the data range (not the header), use Data → Sort range and sort by the helper column or by a column that is always filled in for real records. The blank rows end up together at the bottom, where they no longer get in the way, and you can delete them in one go.

Sorting changes the order of your rows. If the original order matters, first add a column with =ROW(), paste it as values, and sort by it again when you're done.

Step 3: a list without blanks using FILTER

If you'd rather not touch the original data, build a clean copy on another tab. This formula returns every row from A2:D that has something in at least one column:
=FILTER(A2:D, LEN(A2:A&B2:B&C2:C&D2:D))
LEN of the joined row is 0 for empty rows, and FILTER treats 0 as "leave out". The result updates by itself when the source changes.

Step 4: the same with QUERY

QUERY is handy when you also want to pick or reorder columns:
=QUERY(A2:D, "select * where A is not null", 0)
The 0 tells QUERY there is no header row in the range. is not null works best for number and date columns; for text columns, where A <> '' is the more reliable test. To keep rows that have data in any column, combine the conditions: "select * where A <> '' or B <> '' or C <> '' or D <> ''". Keep in mind that QUERY expects one data type per column; in a column that mixes numbers and text, the minority type can come back empty.

Step 5: rows that look empty but aren't

Some rows look blank but contain a space, a non-breaking space (CHAR(160), common in data copied from web pages) or a tab. LEN counts those, so the formulas above keep the row. Strip them before testing:
=FILTER(A2:D, LEN(TRIM(SUBSTITUTE(A2:A&B2:B&C2:C&D2:D, CHAR(160), ""))))
For tabs, line breaks and zero-width spaces as well, use a regular expression:
=FILTER(A2:D, LEN(REGEXREPLACE(A2:A&B2:B&C2:C&D2:D, "[\s\x{00A0}\x{200B}]", "")))
You can also clean the cells first with Data → Data cleanup → Trim whitespace; the guide to removing extra spaces explains the non-breaking space case.

Step 6: careful with formulas that return ""

A cell with a formula such as =IF(B2="","",B2*2) shows nothing, but it isn't empty. ISBLANK returns FALSE for it and COUNTA counts it, while LEN returns 0 and COUNTBLANK counts it as blank. So the LEN-based tests above treat it as empty, which is usually what you want for a clean view. If you delete such rows in the original sheet, you also delete the formulas, so check that nothing else depends on them.

Step 7: check the result with COUNTA and COUNTBLANK

If you built a clean copy with FILTER or QUERY and want to replace the original, copy it and paste it back with Edit → Paste special → Values only. To remove repeated rows as well, see how to remove duplicates.

Doing this every week? CleanSheet does all of these steps in one click: removes duplicates (even "Juan Perez" vs "juan pérez"), formats phones to E.164, lowercases emails and standardizes dates. Free up to 500 rows. See CleanSheet · Get the $9 template