I'm working with Google Spreadsheets and I've run into a wall with a query(IMPORTRANGE) function:

=Query((IMPORTRANGE("URL","Sheet Name!A2:P1000"),"select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10,Col11,Col12,Col13,Col14,Col15,Col16 WHERE Col6 contains 'Abstract & TO'",16))

I keep getting a "Formula Parse Error".

Any suggestions on how to resolve the problem?

  • 2
    The range Sheet Name!A2:P1000 hints that you are already bypassing the header row by starting in row 2. Is this correct? – user82329 May 15 '15 at 21:05
  • Are you using an actual URL (http://... ) as the first parameter of IMPORTRANGE ? Are using the formula as was posted in the question? – Rubén May 15 '15 at 22:41
  • I guess your spreadsheets are not connected for importrange: see the updated answer. – user79865 May 16 '15 at 15:48

You probably want 1 instead of 16 as the last parameter of the query; this parameter means the number of header rows, not of headers.

You also have an extra pair of parentheses in your formula. Otherwise the formula is correct (tested in my spreadsheet), although you could shorten it by replacing select Col1,Col2,..., Col16 with select *

=QUERY(IMPORTRANGE("URL","Sheet Name!A2:P1000"),"SELECT * WHERE Col6 CONTAINS 'Abstract & TO'",1)

A possible source of your errors is that your spreadsheets are not connected for the purpose of IMPORTRANGE:

In the new version of Google Sheets, spreadsheets must be explicitly granted permission to pull data from other spreadsheets using IMPORTRANGE. The first time the destination sheet pulls data from a new source sheet, the user will be prompted to grant permission.

Unfortunately, you will not see this prompt if your IMPORTRANGE command is within a QUERY; the parse error is thrown instead as there is nothing for QUERY to parse. To connect the spreadsheet, import something first, e.g.,

 =IMPORTRANGE("URL","Sheet Name!A1")

You will see #REF error; hovering over it shows an explanation and "connect" button.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.