I am creating a table to display data from a combination of several Spreadsheet files by using Multiple Importrange.

= QUERY ({Importrange (G3, "Sheet1! A2: D"); Importrange (G4, "Sheet1! A2: D"); Importrange (G5, "Sheet1! A2: D")}, "Select Col1, Col2, Col3, Col4 Where Col3 Is Not Null And Col4 Is Not Null ")

The formula above has gone well. Works My file: https://docs.google.com/spreadsheets/d/1eL06DChMSkLuOOj9YNK6KUsVUIqbjcYlKS8pZHLmt_0/edit#gid=0

I insert some Spreadsheet files into the "List Link" table. The link in the table has 3 links.

What I want to ask is how do I overcome the multiple importrange error when the link in the table does not yet exist?

The formula that I have changed is like this:

= IFERROR (QUERY ({Importrange (G3, "Sheet1! A2: D"); Importrange (G4, "Sheet1! A2: D"); Importrange (G5, "Sheet1! A2: D"); Importrange (G6, " Sheet1! A2: D "); Importrange (G7," Sheet1! A2: D ")}," Select Col1, Col2, Col3, Col4 Where Col3 Is Not Null And Col4 Is Not Null "))

The result is empty. Empty

up vote 0 down vote accepted

Wrap each individual IMPORTRANGE call in IFERROR with a null array as the default the length of a filled row if there is an error, like this:

=QUERY({ IFERROR(Importrange(G3,"Sheet1!A2:D"),{"","","",""}); IFERROR(Importrange(G4,"Sheet1!A2:D"),{"","","",""}); IFERROR(Importrange(G5,"Sheet1!A2:D"),{"","","",""}); IFERROR(Importrange(G6,"Sheet1!A2:D"),{"","","",""}); IFERROR(Importrange(G7,"Sheet1!A2:D"),{"","","",""}) },"Select Col1, Col2, Col3, Col4 Where Col3 Is Not Null And Col4 Is Not Null")

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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