1

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?

0

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

NOTE: To avoid confussions instead of using URL use the spredsheet key, because this make clear that the the first parameter refers to the spreasheet only.

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.