Beginner 7 min read

QUERY SELECT in Google Sheets: Choose Columns

Learn how to use QUERY SELECT in Google Sheets to pick specific columns, reorder them, and use aggregate functions. Step-by-step examples and syntax.

SB

Sheets Bootcamp

March 1, 2026

QUERY SELECT in Google Sheets controls which columns appear in the output. Instead of returning all seven columns from a data range, you pick the two or three you need. It is the first clause in every QUERY formula and the foundation for everything else QUERY does. We’ll cover column selection, reordering, using SELECT *, and combining SELECT with aggregate functions.

In This Guide

SELECT Syntax

SELECT is the first clause in a QUERY string. List column letters separated by commas:

Formula
=QUERY(data, "SELECT column1, column2, column3")
PatternWhat It Does
SELECT A, B, CReturns columns A, B, and C
SELECT *Returns all columns
SELECT F, BReturns columns F and B in that order
SELECT B, SUM(F)Returns column B and the sum of column F (requires GROUP BY)

Column letters must match the columns in your data range. If your data starts in column A, then A in the query is the first column. If your data starts in column D, then D in the query is the first column.

Important

Column letters in SELECT refer to the columns in your data range, not the spreadsheet. If your QUERY range is D1:H11, then D is the first column in the query — not A.

How to Use QUERY SELECT: Step-by-Step

We’ll use the same sales records table from the QUERY guide. The data is in A1:G11 with 10 transactions.

Sample Data

ABCDEFG
1DateSalespersonRegionProductUnitsRevenueCommission
21/5/2026Fred WeasleyDiagon AlleyExtendable Ears12$239.88$24.00
31/7/2026Ginny WeasleyHogsmeadeSelf-Stirring Cauldron8$360.00$36.00
41/8/2026Lee JordanDiagon AlleyRemembrall15$525.00$52.50
51/10/2026Fred WeasleyDiagon AlleyOmnioculars5$325.00$32.50
61/12/2026George WeasleyHogsmeadeSneakoscope20$570.00$57.00
71/14/2026Ginny WeasleyHogwartsNimbus 200025$624.75$62.50
81/15/2026Lee JordanHogsmeadeExtendable Ears10$199.90$20.00
91/18/2026Fred WeasleyDiagon AlleyInvisibility Cloak3$269.97$27.00
101/20/2026George WeasleyHogwartsFirebolt8$336.00$33.60
111/22/2026Ginny WeasleyHogsmeadeDeluminator6$330.00$33.00

Sales records table with 10 transactions in Google Sheets

1

Review your data range

Your data is in A1:G11. Row 1 is the header. Seven columns: Date (A), Salesperson (B), Region (C), Product (D), Units (E), Revenue (F), and Commission (G).

2

Select specific columns

Select an empty cell and enter:

Formula
=QUERY(A1:G11, "SELECT B, D, F")

This returns a new table with three columns: Salesperson, Product, and Revenue. The header row carries over automatically. All 10 data rows appear because there is no WHERE filter.

QUERY SELECT returning Salesperson, Product, and Revenue columns

3

Reorder columns in the output

Enter:

Formula
=QUERY(A1:G11, "SELECT F, B, D")

This returns the same three columns, but Revenue appears first, followed by Salesperson and Product. The output order matches your SELECT order.

QUERY SELECT with reordered columns showing Revenue first

Tip

QUERY SELECT is the fastest way to restructure a table without copying data. You get a new view of your data that updates automatically when the source changes.

Select All Columns with SELECT *

The asterisk returns every column:

Formula
=QUERY(A1:G11, "SELECT *")

This is equivalent to =QUERY(A1:G11, "SELECT A, B, C, D, E, F, G"). It is useful when you want all columns but plan to add a WHERE filter, ORDER BY, or LIMIT clause:

Formula
=QUERY(A1:G11, "SELECT * ORDER BY F DESC")

This returns all columns, sorted by Revenue from highest to lowest.

Note

You cannot mix * with specific column letters. SELECT *, B is not valid. Use either * for everything or list the exact columns you want.

Reorder Columns

SELECT returns columns in the order you list them. This lets you rearrange a table without touching the original data:

Formula
=QUERY(A1:G11, "SELECT C, B, F, D")

This returns Region, Salesperson, Revenue, Product — completely different from the original column order. The source data stays unchanged.

You can also repeat a column if needed for layout purposes:

Formula
=QUERY(A1:G11, "SELECT B, F, B")

This returns Salesperson, Revenue, and Salesperson again. Google Sheets appends a number to duplicate headers (e.g., “Salesperson1”) to keep them unique.

SELECT with Aggregate Functions

When paired with GROUP BY, SELECT can include aggregate functions:

FunctionWhat It Does
SUM(col)Adds all values in the column
COUNT(col)Counts non-empty cells
AVG(col)Calculates the average
MIN(col)Returns the smallest value
MAX(col)Returns the largest value

SUM Example

Formula
=QUERY(A1:G11, "SELECT C, SUM(F) GROUP BY C")

This returns one row per region with the total revenue. Diagon Alley: $1,359.85. Hogsmeade: $1,459.90. Hogwarts: $960.75.

QUERY SELECT with SUM showing total revenue per region

COUNT Example

Formula
=QUERY(A1:G11, "SELECT B, COUNT(D) GROUP BY B")

This counts the number of transactions per salesperson. Fred Weasley: 3. Ginny Weasley: 3. George Weasley: 2. Lee Jordan: 2.

Multiple Aggregations

You can include several aggregate functions in a single SELECT:

Formula
=QUERY(A1:G11, "SELECT C, SUM(F), AVG(F), COUNT(F) GROUP BY C")

This returns the total, average, and count of revenue per region in one table.

Important

Every non-aggregated column in SELECT must appear in GROUP BY. If you write SELECT B, C, SUM(F) GROUP BY C, the query breaks because B is not aggregated or grouped. Either add B to GROUP BY or remove it from SELECT.

SELECT with Other Clauses

SELECT pairs with every other QUERY clause. The clauses must follow this order: SELECT, WHERE, GROUP BY, PIVOT, ORDER BY, LIMIT, OFFSET, LABEL, FORMAT.

SELECT + WHERE

Formula
=QUERY(A1:G11, "SELECT B, F WHERE F > 400")

Returns Salesperson and Revenue, but only for transactions over $400. See the QUERY WHERE guide for more filtering patterns.

SELECT + ORDER BY

Formula
=QUERY(A1:G11, "SELECT B, D, F ORDER BY F DESC")

Returns three columns, sorted by Revenue from highest to lowest.

SELECT + LIMIT

Formula
=QUERY(A1:G11, "SELECT B, F ORDER BY F DESC LIMIT 3")

Returns the top 3 transactions by revenue.

SELECT + LABEL

Formula
=QUERY(A1:G11, "SELECT C, SUM(F) GROUP BY C LABEL SUM(F) 'Total Revenue'")

Renames the aggregated column header from “sum Revenue” to “Total Revenue”. See the QUERY GROUP BY guide for more aggregation patterns.

Common Mistakes

Referencing a column outside the data range

If your data is in A1:D11, you cannot use SELECT F — column F is not in the range. QUERY returns a parsing error. Match your column letters to the range you provide.

Using column names instead of letters

SELECT Revenue does not work. QUERY uses column letters: SELECT F. Column letters correspond to positions in your data range, not header text.

Mixing * with specific columns

SELECT *, F is invalid syntax. Use SELECT * alone for all columns. If you want all columns plus a calculated column, you need to list every column letter individually.

Forgetting GROUP BY with aggregate functions

SELECT C, SUM(F) without GROUP BY returns an error. Any time you use SUM, COUNT, AVG, MIN, or MAX in SELECT, you need a GROUP BY clause for the non-aggregated columns.

Tips

1. Use SELECT to create clean reporting views. Instead of hiding columns or copying data, a QUERY SELECT formula gives you a live, filtered view that updates when the source data changes.

2. Combine with LABEL to rename headers. The default aggregation headers (like “sum Revenue”) are not readable. Use LABEL to rename them: LABEL SUM(F) 'Total Revenue'.

3. Pair SELECT with VLOOKUP for two-step lookups. QUERY SELECT can extract a subset of columns, then VLOOKUP can search that result. This is useful when you need to narrow a large dataset before looking up a specific value.

Tip

When building a QUERY formula, start with SELECT * and add clauses one at a time. Once the results look right, narrow the SELECT to only the columns you need. This makes debugging faster.

Frequently Asked Questions

How do you select specific columns with QUERY in Google Sheets?

Use the SELECT clause with column letters separated by commas. For example, =QUERY(A1:G11, "SELECT B, D, F") returns only the Salesperson, Product, and Revenue columns from a 7-column data range.

Can you reorder columns with QUERY SELECT?

Yes. List the columns in the order you want them. =QUERY(A1:G11, "SELECT F, B, D") returns Revenue first, then Salesperson, then Product. The output order matches your SELECT order, not the original data order.

What does SELECT * mean in QUERY?

SELECT * returns all columns from the data range. It is the default if you omit the SELECT clause entirely. Use it when you want all columns but need a WHERE filter, ORDER BY, or LIMIT.

Can you use SELECT with aggregate functions?

Yes. SELECT works with SUM, COUNT, AVG, MIN, and MAX when combined with GROUP BY. For example, =QUERY(A1:G11, "SELECT C, SUM(F) GROUP BY C") returns one row per region with the total revenue.

Frequently Asked Questions

Next Steps

Continue learning with these related tutorials: