How to Remove ‘sum’ from Headers in QUERY Results in Google Sheets?
When working with Google Sheets, one of the most useful formulas for summarizing large data is QUERY. It allows you to group, filter, and calculate totals without using Codes and Pivot Tables, which are often too clumsy.
However, there’s a small issue that often shows up —
When you use SUM() inside a QUERY, the output header automatically displays something like “sum Hours Worked”, “sum Man Days”, and so on.
While the data is correct, the headings look unpolished and are not suitable for reports or dashboards.
In one of my recent projects involving an Attendance Management Sheet, I had to fix this exact problem.
Here’s the method I used, which you can directly apply.
Step 1: Understand Why It Happens
Whenever you use aggregation functions like SUM(), COUNT(), or AVG() in QUERY, Google Sheets adds the function name before the Column Heading.
For example:
SUM(K)
becomes:
sum Hours Worked
This is automatic unless you manually override it.
Step 2: The Correct Way to Remove ‘sum’ from Headers
The solution is simple —
Use the LABEL clause inside your QUERY.
Here’s an example:
=QUERY(Attendance!A1:Q, “SELECT N, M, B, Q, SUM(K), SUM(L), SUM(P) WHERE N IS NOT NULL GROUP BY N, M, B, Q ORDER BY N ASC, M ASC, B ASC, Q ASC LABEL N ‘Financial Year’, M ‘Month’, B ‘Date’, Q ‘Group’, SUM(K) ‘Hours Worked’, SUM(L) ‘Man Days’, SUM(P) ‘Daily Wages'”, 1)
A few important points:
The LABEL section comes at the end of the QUERY, after GROUP BY and ORDER BY.
You must exactly match the column reference inside LABEL. (e.g., SUM(K) not just K).
You can rename any field — even the non-sum fields if needed.
Step 3: Final Output
After applying the correct LABEL, the output will have neat, clean headers like:
No unwanted “sum” text, no confusion — perfectly clean and ready for reporting.
Why This Step Is Important?
While it may seem like a minor issue, clean headers can make a big difference:
- They make your reports look more professional.
- They make the data easier to read and understand.
- They avoid confusion if someone else uses your sheets later.
In my experience, small refinements like this often leave a better impression when sharing sheets with clients, colleagues, or management teams.