William Toscano
William Toscano

Reputation: 225

Importrange where Row row(NamedRange) = true

On the "Import" sheet, we want to import "Main" but only the columns that have a checkbox checked on named range "checks" which happens to be range 1:1. Here is the formula I tried.

=INDEX(QUERY(TO_TEXT(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1jdpF-4b76XkZ8jASNwQmdK9hnd_XEpaVA9U6bPkUsyE/edit#gid=2083288698", "Main!1:999")),   "where Row"&Row(checks)&" is true", 0))

I also want to skip rows that are completely blank. Only import rows that have a value on at least one of the columns.

Here is the link to the spreadsheet

Here is a screenshot.

Picture of Main

Picture of Sheet to Import Main to.

Upvotes: 0

Views: 955

Answers (1)

player0
player0

Reputation: 1

try:

=INDEX(QUERY(TRANSPOSE(QUERY(TRANSPOSE(TO_TEXT(IMPORTRANGE(
 "1jdpF-4b76XkZ8jASNwQmdK9hnd_XEpaVA9U6bPkUsyE", "Main!1:999"))), 
 "where Col1 = 'TRUE'", )), "offset 1", ))

enter image description here


update 1:

=INDEX(SUBSTITUTE(SPLIT(QUERY(TRIM(FLATTEN(QUERY(TRANSPOSE(
 SUBSTITUTE(QUERY(TRANSPOSE(QUERY(TRANSPOSE(TO_TEXT(IMPORTRANGE(
 "1jdpF-4b76XkZ8jASNwQmdK9hnd_XEpaVA9U6bPkUsyE", "Main!1:999"))), 
 "where Col1 = 'TRUE'", )), "offset 1", ), " ", CHAR(13))),,9^9))),
 "where Col1 is not null", ), " "), CHAR(13), " "))

enter image description here


update 2:

=INDEX(SUBSTITUTE(SPLIT(QUERY(TRIM(FLATTEN(QUERY(TRANSPOSE(
 SUBSTITUTE(QUERY(TRANSPOSE(QUERY(TRANSPOSE(TO_TEXT(IF(IMPORTRANGE(
 "1jdpF-4b76XkZ8jASNwQmdK9hnd_XEpaVA9U6bPkUsyE", "Main!1:999")="", "×", IMPORTRANGE(
 "1jdpF-4b76XkZ8jASNwQmdK9hnd_XEpaVA9U6bPkUsyE", "Main!1:999")))), 
 "where Col1 = 'TRUE'", )), "offset 1", ), " ", CHAR(13))),,9^9))),
 "where not Col1 contains '×'", ), " "), CHAR(13), " "))

enter image description here

Upvotes: 2

Related Questions