Formula guide · Google Sheets · Updated May 13, 2026

Google Sheets QUERY Label

Rename QUERY output columns in Google Sheets with the label clause.

Quick Answer

Use the label clause at the end of a QUERY to rename selected or aggregated output columns.

Copyable Formula

=QUERY(A1:D100,"select A, sum(D) group by A label sum(D) 'Total amount'",1)

Syntax

=QUERY(A1:D100,"select A, sum(D) group by A label sum(D) 'Total'",1)

Google Sheets

Worked Example

AD
RegionAmount
West120
West80

Result: Returns a grouped report with Total amount as the aggregate column header.

Steps

  • Build the QUERY result first.
  • Add label near the end of the query string.
  • Reference aggregate labels exactly, such as sum(D).
  • Put the new label inside single quotes.

Common Mistakes

  • Labeling the wrong aggregate expression.
  • Forgetting quotes around the new label.
  • Putting label before group by or order by.

Excel vs Google Sheets Notes

This page is focused on Google Sheets. Excel may require a different function, pivot table, or Power Query workflow.

Editorial check: This guide was last updated May 13, 2026. Formula behavior can vary by Excel version, Google Sheets rollout, and spreadsheet locale.

FAQ