The LABEL clause in the Google Sheets QUERY function lets you rename or remove column headers in the query output. It’s especially useful when Google Sheets generates less meaningful headers such as sum Sales, year(Date), or product(sum Units10()), or when you want different column names without editing the source data.
In this guide, you’ll learn how to rename regular columns, aggregation results, scalar functions, arithmetic expressions, and even remove headers entirely using the LABEL clause.
In the QUERY syntax, the LABEL clause appears second to last, immediately before the FORMAT clause, which is the final clause.
The LABEL clause can:
- rename regular columns,
- rename calculated columns,
- remove column headers, and
- assign headers to data without a header row.
Quick Reference Cheat Sheet
| Goal | Formula Example |
|---|---|
| Rename a column | SELECT A, G LABEL G 'Revenue' |
| Rename multiple columns | SELECT B, C, G LABEL B 'Sales Rep', C 'Sales Region', G 'Revenue' |
| Remove a header | SELECT G LABEL G '' |
| Rename an aggregation | SELECT C, SUM(G) GROUP BY C LABEL SUM(G) 'Total Sales' |
| Rename a scalar function | SELECT YEAR(A), SUM(G) GROUP BY YEAR(A) LABEL YEAR(A) 'Year', SUM(G) 'Revenue' |
| Rename an arithmetic expression | SELECT B, SUM(E)*10 GROUP BY B LABEL SUM(E)*10 'Bonus Points' |
Syntax: Labeling Columns
The basic syntax of the LABEL clause is:
LABEL column_id 'label_string'
column_id: The column identifier to label. Use column letters (A,B, etc.) when querying a physical range, andCol1,Col2, etc., when querying an array expression such as{A1:B}orIMPORTRANGE(...). Thecolumn_idcan also be an expression, such as an aggregation function (SUM(D),MAX(Col4)), a scalar function (YEAR(A)), or an arithmetic expression (A+B,SUM(B)-SUM(C)).label_string: The custom column header enclosed in single quotes, for example,'Total Sales'. Use an empty string ('') to remove the column header altogether.
When renaming multiple columns in a single QUERY formula, use the LABEL keyword only once and separate each column identifier and label pair with commas. Any columns or expressions not included in the LABEL clause will retain their default header names.
Tip: Label text can be enclosed in either single quotes ('Revenue') or doubled double quotes (""Revenue""). Doubled double quotes are useful when the label contains an apostrophe, for example: LABEL G ""Student's Grade""
Sample Data

Click the button below to make a copy of the sample sheet and follow along with the examples.
Example 1: Rename Regular Columns
You can also use the LABEL clause to rename regular columns. Although you can usually edit the source headers, there are situations where that’s not practical. For example:
- The data comes from a Google Form response sheet.
- The data is imported using IMPORTRANGE, and you don’t have permission to edit the source sheet.
- You want different header names for different query results.
In these situations, the LABEL clause lets you assign custom column headers without modifying the source data.
Formula:
=QUERY(A1:G, "SELECT A, G LABEL A 'Order Date', G 'Revenue'", 1)
This formula returns the Date and Sales columns, but renames their headers to Order Date and Revenue, respectively, without modifying the source data.

Important: When the query source is an expression such as IMPORTRANGE(...), use Col1, Col2, etc., instead of column letters. This applies to all examples in this tutorial.
If the data source is IMPORTRANGE(...), use:
=QUERY(IMPORTRANGE("spreadsheet_url","Sheet1!A:G"), "SELECT Col1, Col7 LABEL Col1 'Order Date', Col7 'Revenue'", 1)
Example 2: Rename Aggregation Headers
When you use aggregation functions such as SUM, COUNT, AVG, MIN, or MAX, Google Sheets automatically generates headers such as sum Sales or count Sales. You can use the LABEL clause to replace these default headers with more meaningful names.
Formula:
=QUERY(A1:G, "SELECT C, SUM(G) WHERE C IS NOT NULL GROUP BY C LABEL SUM(G) 'Total Sales'", 1)
This formula groups the data by Region (column C) and returns the total sales for each region.
The LABEL clause renames the aggregation header from sum Sales to Total Sales.

Example 3: Rename Scalar Function Headers
Scalar functions behave the same way. Common scalar functions in the QUERY function include YEAR, MONTH, DAY, HOUR, and DATE.
You can use the LABEL clause to replace these automatically generated headers with more descriptive names.
Formula:
=QUERY(A1:G, "SELECT YEAR(A), MONTH(A), SUM(G) WHERE A IS NOT NULL GROUP BY YEAR(A), MONTH(A) LABEL YEAR(A) 'Year', MONTH(A) 'Month', SUM(G) 'Revenue'", 1)
This formula groups the data by Year and Month and returns the total revenue for each month. The LABEL clause renames the generated headers to Year, Month, and Revenue.

Example 4: Rename Headers for Arithmetic Expressions
Arithmetic expressions can generate some of the longest and most cumbersome headers in a QUERY result.
For example, an expression such as SUM(E)*10 may generate a header like product(sum Units10()) (or a similar automatically generated label).
You can use the LABEL clause to replace these with meaningful column names.
Formula:
=QUERY(A1:G, "SELECT B, SUM(E)*10 WHERE B IS NOT NULL GROUP BY B LABEL SUM(E)*10 'Bonus Points'", 1)
This formula groups the data by Salesperson (column B) and calculates Bonus Points by multiplying the total units sold by 10.

Without the LABEL clause, the second column would display an automatically generated header such as product(sum Units10()) . The LABEL clause replaces this with the much clearer header Bonus Points.
Working with Data That Has No Header Row
All of the examples above assume that the source data contains a header row. However, in some situations the source data may not have headers—for example, when you extract a portion of a dataset or generate data using a formula.
In such cases, specify the headers argument (the third argument of QUERY) as 0 instead of 1. Since there are no source headers to inherit, the output column headers will be blank unless you define them using the LABEL clause.
For example:
=QUERY(A2:G, "SELECT A, G LABEL A 'Date', G 'Revenue'", 0)
This formula treats the data as having no header row and assigns Date and Revenue as the output column headers.
Frequently Asked Questions
Can I rename Pivot column headers?
No. The LABEL clause cannot rename pivot column headers. Pivot headers are generated from the unique values in the pivot column, so they are treated as categories, not column names.
Do I need to follow a specific clause order when using the LABEL clause?
Yes. The LABEL clause must appear near the end of the query. It comes after clauses such as SELECT, WHERE, GROUP BY, PIVOT, ORDER BY, LIMIT, and OFFSET.
If you also use the FORMAT clause, LABEL must appear immediately before it, because FORMAT is always the final clause in a QUERY statement.
Related: What is the Correct Clause Order in Google Sheets Query?
Can I remove only one column header?
Yes. Specify an empty label.
LABEL G ''
Other column headers remain unchanged.
Conclusion
The LABEL clause makes QUERY results easier to read by replacing Google’s automatically generated headers with meaningful names. Whether you’re renaming regular columns, aggregation results, scalar functions, or arithmetic expressions—or simply removing a header—it helps you create cleaner and more informative query output.
Remember to use the same column identifiers or expressions as in the SELECT clause, and place the LABEL clause immediately before the optional FORMAT clause.





Good morning,
Thanks for these great examples.
I can’t replace the months in figures in my formula with their names.
Thanks for the help.
Hi, Terrasson,
You can’t format
month(A)+1to month names.I suggest converting column A dates to month-end dates using the EOMONTH function.
Then you can use A instead of the
month(A)+1to group or aggregate. Then you can format it into month names.This tutorial may help: How to Group Data by Month and Year in Google Sheets.
Hi, If I have a Query that populates a column with a string, for example,
"select 'Canada', B, Sum(C)"and I want to set a label for the column'Canada', what syntax can I use?Thank you!
Hi, Caroline,
This example might help you.
=query(A1:C,"select 'Canada', B, Sum(C) group by 'Canada',B label 'Canada''New Column'")Replace
New Columnwith the label you want.How can I have a label with a referring cell address in select?
=query(A4:B16,"Select A/"&C3&"")Hi, Laurent,
I am not clear. Please elaborate.
You, sir/madam, are awesome! I’ve been trying to figure out how to label column headers after the pivot.
This is exactly what I was looking for. Thank you!
This was exactly what I was looking for, I couldn’t find a way to label aggregated columns with formulas. Thanks!
Hi, Marcela,
I have detailed that within the tutorial.
For example, if you use the function
sum(B), you can label this column aslabel sum(B)'Total'.Can I give a label name by referring to a cell address? Say Label A2 where A2 contains Total.
Hi, Suresh,
Yes! It’s possible. It is similar to the string literal use in Query.
=query(A4:B16,"Select A,B label A'"&A2&"',B'"&A1&"'")