I am using IMPORTRANGE within a query to extract data from sheet 1 to sheet 2. The following code is in a cell in tab A of sheet 2, and works as intended:

=query(importrange("URL-A","E:J"), "select * where Col6 = TRUE AND Col4 IS NOT NULL")

That is, it extracts the correct data from sheet 1, tab A. Note that URL-A is specific to tab A.

However, when I attempt to extract data from tab B:

=query(importrange("URL-B","C:J"), "select * where Col2 IS NOT NULL AND Col8 = TRUE AND Col6 IS NOT NULL")

where URL-B is specific to tab B, the data is still being extracted from tab A.

In other words, IMPORTRANGE seems to be extracting data from the first tab, despite specifying URLs that are specific to other tabs.

Is there additional or different IMPORTRANGE syntax required to refer to different tabs?

1 Answer 1


Instead of using "E:J" and "C:J" use "tab a!E:J" and "tab b!C:J" where tab a and tab b are the tab names.

NOTE: To avoid confusion, instead of using URL use the spreadsheet key, because this makes clear that the first parameter refers to the spreadsheet only.


Your Answer

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

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