Google 需要 ifs 语句的工作表查询

Google sheets query in need of a ifs statement

我正在尝试 select 不同的列,具体取决于找到特定字符串的列。 这是我当前的查询。

=QUERY(IMPORTRANGE(Configuration!I5,"Employes!A2:Z"),"select Col26, Col3 where Col16 = '"&D27&"' or Col18 = '"&D27&"' or Col20 = '"&D27&"'")

现在,它只带来 2 列数据,但我需要它也带来在它会找到“D27”的那一列之后的列。

尝试

=query({
QUERY(IMPORTRANGE(Configuration!I5,"Employes!A2:Z"),"select Col26,Col3,Col16,Col17");
QUERY(IMPORTRANGE(Configuration!I5,"Employes!A2:Z"),"select Col26,Col3,Col18,Col19");
QUERY(IMPORTRANGE(Configuration!I5,"Employes!A2:Z"),"select Col26,Col3,Col20,Col21")},
"select Col1,Col2,Col4 where Col3='"&D27&"'")