Google Sheets Query: How to Ignore Blank Cells in Query


You can use the following methods to ignore blank cells in specific columns when performing a Google Sheets query:

Method 1: Ignore Blank Cells in One Column

=QUERY(A1:C11, "select * where B is not null")

Method 2: Ignore Blank Cells in Multiple Columns

=QUERY(A1:C11, "select * where B is not null and C is not null")

The following examples show how to use each formula in practice with the following dataset in Google Sheets:

Example 1: Query Rows & Ignore Blanks in One Column

We can use the following formula to select all rows where the Points column is not blank:

=QUERY(A1:C11, "select * where B is not null")

The following screenshot shows how to use this formula in practice:

Google sheets query ignore blank cells

Notice that only the rows where the Points column is not blank are returned.

Example 2: Query Rows & Ignore Blanks in Multiple Columns

We can use the following formula to select all rows where the Points column and the Assists column is not blank:

=QUERY(A1:C11, "select * where B is not null and C is not null")

The following screenshot shows how to use this formula in practice:

Notice that this query only returns the rows where the Points column and the Assists column is not blank:

Additional Resources

The following tutorials explain how to perform other common tasks with Google Sheets queries:

Google Sheets Query: How to Query From Another Sheet
Google Sheets Query: Select Rows that Contain String
Google Sheets Query: How to Use Group By
Google Sheets Query: How to Use Order By

Leave a Reply

Your email address will not be published.