当其他查询使用 Google Sheets 公式返回 #N/A 时,如何从一个查询返回找到的值?

问题描述 投票:0回答:1

该公式将 3 个

QUERY()
合并为 1 个,以便结果垂直设置。问题是,当其中一个查询找不到任何值时,它会返回一个
#VALUE
表示:

在 ARRAY_LITERAL 中,数组文字缺少一行或多行的值。

我尝试过

IFERROR()
,将其全部包裹在另一个
QUERY()
中,但它不起作用。

=QUERY({
query({Sheet1!A:FR},"Select Col142,Col11,Col12,Col74 where Col7 = '"&P4&"' and not Col142 contains '#N/A' and not Col142 matches '-' and Col142 is not null",0);
query({Sheet1!A:FR},"Select Col150,Col11,Col12,Col78 where Col7 = '"&P4&"' and not Col150 contains '#N/A' and not Col150 matches '-' and Col150 is not null",0);
query({Sheet1!A:FR},"Select Col152,Col11,Col12,Col82 where Col7 = '"&P4&"' and not Col152 contains '#N/A' and not Col152 matches '-' and Col152 is not null",0)
},"select * where Col1 <> '#N/A' and Col1 is not ''")

接下来我可以尝试什么?

google-sheets google-sheets-formula
1个回答
2
投票

您必须对每个单独的查询应用 iferror 并给出完整的一行空白,即

iferror(query(_____________),{"","","",""})

if 查询应该每行获取 4 个结果

© www.soinside.com 2019 - 2024. All rights reserved.