IMPORTRANGE with condition

久未见 提交于 2019-12-03 23:06:00

I have put a few examples in the following spreadsheet:

e.g. =QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1LX7JfbGvgBTfmXsYZz0u5J7K0O6oHJSnBowKQJGa9lY/edit#gid=0", "Inc Database!A2:B300"),"SELECT Col1 WHERE not(Col2 = 'Permanent') ")

You need a single quote around the reference to the sheet/tab since there is a space in the name. Using your example:

IMPORTRANGE("https:/URL", "'Inc Database'!A2:A300")

But this will only import column A, so you cannot check against column B

Then use the Query. If you want everything where B is 'Permanent' then you want (untested):

=QUERY(IMPORTRANGE("https:/URL", "'Inc Database'!A2:B"),"SELECT Col1 WHERE Col1 = 'Permanent'")

This will:

  • Import all of the rows, starting at A2 from the main data sheet to use in the Query().
  • Via Query, return only those where Col2 (B) contains 'Permanent'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!