Google 工作表上 QUERY 和 IMPORT Range 函数的错误消息是什么意思?

what does this error message for QUERY and IMPORT Range function on Google Sheets mean?

=query(IMPORTRANGE("URL","Audit Template!A1:AD994"), "SELECT a,b,c,g,p WHERE b = 'name’ AND p = 'yes'")

错误:

Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "yes "" at line 1, column 55. Was expecting one of: "group" ... "pivot" ... "order" ... "skipping" ... "limit" ... "offset" ... "label" ... "format" ... "options" ... "and" ... "or" ...

意味着如果你使用间接范围如IMPORTRANGE那么你需要使用Col引用:

=QUERY(IMPORTRANGE("URL", "Audit Template!A1:AD"), 
 "select Col1,Col2,Col3,Col7,Col16
  where Col2  = 'name' 
    and Col16 = 'yes'", 0)

更新:

=QUERY(IMPORTRANGE("1gUxnjlhZlTgpw0gf-wuBgbf0zqmiKmoZKLCbfxQ6p5E", "Audit Template!A1:AD"), 
 "select Col1,Col2,Col3,Col7,Col16
  where Col1 contains 'name' 
    and Col16 = 'yes'", 1)

spreadsheet demo