Use Of Query Formula – Remove Blanks in Google Sheet
The QUERY formula in Google Sheets can be used to remove blanks from a range of data. Here's how to use the QUERY formula to remove blanks:
- Select a cell where you want to display the filtered data.
- Type the following formula in the cell:
- =QUERY(range, "SELECT * WHERE Col1 <> '' ")
3. Press Enter.
The QUERY formula will return the filtered data without any blank cells.
Here's a breakdown of the formula:
- The "SELECT *" statement selects all columns in the data range.
- The "WHERE Col1 <> '' " statement filters out any rows where the value in the first column (Col1) is not blank.
Note that if you have a header row in your data range, you can add the "LABEL" statement to the formula to include the header row in the filtered data. Here's an example:
- =QUERY(range, "SELECT * WHERE Col1 <> '' LABEL Col1 'Header1', Col2 'Header2', Col3 'Header3'")
Replace "Header1", "Header2", and "Header3" with the names of your actual column headers.
This formula will return the filtered data with the column headers included.
No comments:
Post a Comment