Filter Out If the Entire Row Is Blank in Google Sheets

How do I filter out rows where all cells — or, in other words, the entire row — are blank in Google Sheets? I don’t want to use any helper columns for this.

Usually, we decide a row is blank if the first cell in that row is blank, because most of the time, the first column in a table contains timestamps or IDs.

But in this case, we don’t want to follow that method. We want to check if any cell in a row has a value — and if so, return that row.

For example, I have a sample table filled with my birding data in Google Sheets.

The fields are: “Scientific Name,” “Common Name,” “Locale,” “State,” “Country,” “Number of Occurrences,” and “Date.”

The range is A1:G.

We want to filter out rows where the entire row is blank.

Of course, we can use either the FILTER function or the Filter menu to do that.

When using the FILTER function, there are two approaches: In the condition part of the formula, you can either use a LAMBDA formula or a QUERY formula.

Filter Out If All Cells in a Row Are Blank: QUERY Approach

Here is my sample birding data:

Sample birding data used for filtering experiment in Google Sheets

In this table, there are two fully blank rows — A5:G5 and A7:G7.

We can use the following FILTER formula in cell I1:

=FILTER(A1:G, LEN(TRIM(TRANSPOSE(QUERY(TRANSPOSE(A1:G),,9^9)))))
Example showing how to use a formula to filter out rows where the entire row is blank in Google Sheets

How Does It Work (Especially the QUERY Part)?

In the above formula, QUERY is used to join columns dynamically so we can check — using LEN — whether the combined row has any value.

It works like this:

  • QUERY Syntax: QUERY(data, query, [headers])
  • data: TRANSPOSE(A1:G)
  • query: (nil — left empty)
  • headers: 9^9

By specifying 9^9 (an arbitrarily large number) for the headers argument, we tell QUERY that all rows are headers. As a result, QUERY combines them into a single row.

We must use transposed data; otherwise, QUERY would combine values column-wise instead of row-wise.

(You can try using =QUERY(A1:G9,,9^9) directly in your Sheet to observe how it works.)

Filter Out If All Cells in a Row Are Blank: LAMBDA Approach

Alternatively, we can use the BYROW function to process each row individually:

=FILTER(A1:G, LEN(BYROW(A1:G, LAMBDA(row, TEXTJOIN("", TRUE, row)))))

How It Works:

  • BYROW processes each row of the range.
  • Inside the LAMBDA, TEXTJOIN combines all cells in the row into a single text string.
  • LEN returns the length of that string — if it’s greater than 0, the row contains data.
  • Finally, FILTER keeps only those rows where the length is greater than 0.

This is another efficient way to filter out rows where all cells are blank.

How to Do This Using the Filter Menu

You can also use the Filter menu to filter out empty rows without writing a formula.

Here’s how:

  1. Select the range (e.g., A1:G).
  2. Click Data > Create a filter.
  3. Click the filter drop-down in cell A1 and choose Filter by condition > Custom formula is.
  4. Enter the custom formula:
    • To show non-blank rows:
      =COUNTIF($A2:$G2, "<>")
      Filter menu settings to filter out or display empty rows in Google Sheets
    • To show only blank rows:
      =COUNTIF($A2:$G2, "<>")=0
  5. Click OK.
Filtering out blank rows in Google Sheets using the Filter menu

This method lets you easily view only the rows that are fully blank or those that contain at least one value.

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

How to Sort Pie Slices in Google Sheets

To sort pie slices in a pie chart, you need to sort the data...

Filter Items Unique to Groups in Google Sheets

In this tutorial, we'll learn how to filter items unique to groups in Google...

Find Common Items Across Multiple Columns in Google Sheets

This tutorial explains how to find common items across multiple columns in Google Sheets....

Sort Column by Length of Text in Google Sheets

To sort a column by length of text, you can either use the QUERY...

More like this

How to Sort Pie Slices in Google Sheets

To sort pie slices in a pie chart, you need to sort the data...

Filter Items Unique to Groups in Google Sheets

In this tutorial, we'll learn how to filter items unique to groups in Google...

Find Common Items Across Multiple Columns in Google Sheets

This tutorial explains how to find common items across multiple columns in Google Sheets....

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.