Search code examples
arraysgoogle-sheetsgoogle-sheets-formulagoogle-sheets-query

Google Sheet Query Formula


Is there any way that without importing the data in helping sheet we can use vlookup as I have created in Sheet1 to lookup the values from other sheet “Directly” by using IMPORITNG (Query formula? Here is current formula.

=ArrayFormula({"Comments";IF(A2:A="","",IFERROR(VLOOKUP(TRIM(A2:A)&B2:B&"|"&C2:C&D2:D,{TRIM('Sheet1 Import'!A2:A)&'Sheet1 Import'!B2:B&"|"&'Sheet1 Import'!C2:C&'Sheet1 Import'!D2:D,'Sheet1 Import'!E2:E},2,FALSE),"*** NOT FOUND ***"))})

But above formula is taking the data from helping sheet I am trying to create a formula that directly match the result and take relevant data from another sheet.

I have created this formula but its not working ?

=INDEX(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0", "Sheet1!E:E"),MATCH(1,(A2,IMPORTRANGE("https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0", "Sheet1!A2:A")(B2,IMPORTRANGE("https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0", "Sheet1!B2:B")(C2,IMPORTRANGE("https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0", "Sheet1!C2:C"),0)))))

Sheet links

https://docs.google.com/spreadsheets/d/1x7ofB9Rt-y5_DlaxQVIZK_ZKR8sqBHVxAu3ZZlU13YA/edit#gid=0

https://docs.google.com/spreadsheets/d/1_9Vumt1a-1WnrXAHOpJd1GUTQ3jLjPifwGyKlDDRyi0/edit?usp=sharing


Solution

  • From the question

    Is there any way that without importing the data in helping sheet we can use vlookup as I have created in Sheet1 to lookup the values from other sheet “Directly” by using IMPORITNG (Query formula?

    One way is to add the VLOOKUP formula on the source spreadsheet then import the result. Another way is to use Google Apps Script.