
However, there is one case where the QUERY function will generate headers automatically even if you remove the header row from your input, set headers to 0, and apply an OFFSET clause.
These two solutions are both great solutions. But when you print out the result, don’t print out the first row.” Then, through our OFFSET clause, we tell QUERY, “Go and get all the data from A:C. And when we set the third parameter to 0, we’re telling the QUERY function that there are no header rows in that range. In this particular instance, we’re treating the first row as though it weren’t a header row. In our case, we’re skipping just one row in the result: the header row. For example, OFFSET 3 would skip the first 3 rows returned in the resulting dataset. The OFFSET clause skips the first X number of rows in the result or your query. =QUERY(A:C, "SELECT A, B, C OFFSET 1", 0) Bob The second option is to use the entire range and apply an OFFSET clause to your query, again also setting the third parameter in your function to 0. Also, notice the addition of the third parameter which is set to 0. Notice that the range in our query is set to A 2:C rather than A:C. There are a few ways to prevent headers from being generated in the output.īut before we get into the weeds, let’s take a look at the raw dataset we’ll be working with.įirst, you can simply exclude the header row from the input and set the third parameter in your QUERY function to 0 (which tells the QUERY function that there are 0 header rows in the range).Īnd here’s our query to remove the header row by excluding it from our range and setting the headers parameter to 0. But what if you don’t want the header row at all?

And one of the great things about QUERY is that it can interpret the first row of data as a header row. The Google Sheets function “QUERY” is one of the handiest functions in a Google Sheets wizard’s toolbox.
