Home > Software design >  Google Sheets Query And Importrange Equals Cell D2
Google Sheets Query And Importrange Equals Cell D2

Time:11-03

I've got two spreadsheets, a primary sheet (that a google form dumps into) and another sheet (aka management sheet) that has shared access to the primary sheet. I'm trying to run the query below to automatically import a serial number based on the hostname in column D of the management sheet.

I can run a simple importrange successfully, so the access permissions are working properly.

=QUERY(IMPORTRANGE("[URLHERE]”, “Form Responses 1!A2:H”), ”Select Col7 where Col5="&$D2))

Any help would be appreciated, thanks in advance!

Jerome

CodePudding user response:

I figured it out.

=query({IMPORTRANGE("1pRWLfnYsJhmJFZio_pvny7oO8UCSUxfGhTc78TbwVhw", "Form Responses 1!A2:H")}, "Select Col7 where Col5 = '"&D2&"' LIMIT 1",0)

Jerome

CodePudding user response:

try:

=SINGLE(QUERY({IMPORTRANGE("1pRWLfnYsJhmJFZio_pvny7oO8UCSUxfGhTc78TbwVhw", 
 "Form Responses 1!A:H")}, "select Col7 where Col5 = '"&D2&"'", )
  • Related