0

While removing the header row in a Google sheets query function seems straightforward, I don't see any suggestions on removing the header row when the query involves a pivot. For reference, I am giving a link with viewing rights to a spreadsheet which replicates the structure of the one I am working with.

The query is in cell C4 of the tab "Query sheet" and reads as follows:

= QUERY('Class hours'!A2:C11,"select sum(C) WHERE A='" & A5 & "' group by A pivot B")

The aim is to remove the row headers in cells C4:E4 in this sheet so that this function can be copied down column C to include all names in Column A with corresponding Sum (C) in the rows. Thanks for your attention.

1 Answer 1

2

try this:

=QUERY(QUERY('Class hours'!A2:C11,
 "select sum(C) 
  where A = '"&A5&"' 
  group by A 
  pivot B"), 
 "offset 1", 0)

or even this in your case:

=INDEX(QUERY('Class hours'!A2:C11,
 "select sum(C) 
  where A = '"&A5&"' 
  group by A 
  pivot B"), 2)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.