Syntax or pattern
Use QUERY to select specific columns from a range.
=QUERY(data, "select A, B, C", 1)5 practical examples
Select useful columns from raw data
Return only the columns needed for a clean report view.
=QUERY(A1:E, "select A, C, E", 1)Adjust the ranges, criteria and sheet names to match your workbook.
Select rows from a named range
Use a named range so the formula is easier to read.
=QUERY(SalesData, "select A, B, D", 1)Adjust the ranges, criteria and sheet names to match your workbook.
Select columns and rename later
A simple first step before adding labels or formatting.
=QUERY(A1:D, "select A, D", 1)Adjust the ranges, criteria and sheet names to match your workbook.
Select only non-empty rows
Avoid showing blank rows in a dashboard table.
=QUERY(A1:D, "select A, B where A is not null", 1)Adjust the ranges, criteria and sheet names to match your workbook.
Select imported data
Combine IMPORTRANGE and QUERY for a cleaner external table.
=QUERY(IMPORTRANGE(B1, "Data!A:E"), "select Col1, Col3", 1)Adjust the ranges, criteria and sheet names to match your workbook.
Common mistakes to avoid
- Using column letters instead of Col1 notation with imported array data.
- Forgetting quotes inside QUERY strings.
- Grouping without aggregating non-grouped columns.
FAQ
What is this Google Sheets page for?
This page gives copy-ready examples for query select examples so you can understand the pattern and adapt it to real spreadsheet work.
Can I copy these formulas directly?
Yes. Use the copy buttons, then adjust sheet names, ranges, criteria and column references for your own file.
Why does my formula return an error?
The most common causes are mismatched ranges, missing quotes around text criteria, blank source data, or references that do not match your sheet layout.