I'm having an issue with the Query(Importrange) function of Google Sheets.

I'm using the following formula

=Query(IMPORTRANGE('Importrangelink,"'Sheetname'!X1:AA130"),"select Col1,Col2,Col3 where Col4 = 'No'")

This works however if I extend the selection to AA131 (There is Data in AA131) then all I get returned are the headers. Alternatively if I instead of inputting X1:AA130 , put X:AA then again all I get are the headers.

Would someone know why this is as I have another sheet with this formula requesting the full columns and it works as expected

=Query(IMPORTRANGE('Importrangelink',"'Sheetname'!A:F"),"select * where Col6 = 'Yes'")

  • Welcome. Sorry to be pedantic but would you please advise whether (in your formulas): is the importlink between single quotes or double quotes; is the range (including sheet name) between single quotes or double quotes; what is the value in cell AA131? – Tedinoz Apr 1 at 2:29
  • 2
    Does this answer your question? importrange with query not working properly – Tedinoz Apr 1 at 2:35
  • It is always difficult to assess a problem sight-unseen. Details matter. However, I do notice that range in the formula you report works find starts simply with "A:" while the problematic formula starts with "X1:" (instead of simply "X:"). I suggest changing "X1" to "X"; and if that does not resolve the issue, try adding the headers parameter to the QUERY (i.e., a comma and digit 1 after the select ending quote and before the QUERY closing parenthesis). If you still find nothing is working, I encourage you to share a link with permissions "Anyone with the link..." and "Editor." – Erik Tyler Apr 1 at 3:10

Your Answer

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

Browse other questions tagged or ask your own question.