Search code examples
sqlarraysgoogle-sheets-formulaoffsetgoogle-query-language

How to get rid of response headings in Google Sheets?


I read an API with Google Sheets and want to get results similarly to this:

+-------+-------------------+-----------------+
| Input | Formula           | Result column   |
+-------+-------------------+-----------------+
| 11    | =MyApiFormula(A2) | responseValue11 |
+-------+-------------------+-----------------+
| 22    | =MyApiFormula(A3) | responseValue22 |
+-------+-------------------+-----------------+

But the API is a bit strange and puts always a header row into response. With it, the response of the first formula looks like:

+-------+-------------------+-------------------+
| Input | Formula           | Result column     |
+-------+-------------------+-------------------+
| 11    | =MyApiFormula(A2) | responseHeading11 |
+-------+-------------------+-------------------+
|       |                   | responseValue11   |
+-------+-------------------+-------------------+

and the second formula (=MyApiFormula(A3)) doesn't work at all - sure, because it is forced to write into cells with already existing data.

I guess, this heading row can be avoided with a =QUERY formula with INDEX and an offset -1 - but I fail with correct syntax.

Could somoebody point me to the correct writing?


Solution

  • QUERY syntax would be:

    =QUERY(...; "offset 1"; 0)
    

    substitute dots for your formula