我有数据,我想将其与 IMPORTRANGE 结合起来。对于每个 IMPORTRANGE,我想随后添加一个包含特定数据的列。
我已经尝试过这个
=QUERY({
IMPORTRANGE(Sheet1!C2; Sheet1!D2 & "!A3:Q");
ARRAYFORMULA(IF(LEN(IMPORTRANGE(Sheet1!C2; Sheet1!D2 & "!A3:Q")); "Location1"; ""));
importrange(Sheet1!C3;Sheet1!D3&"!A3:Q");
ARRAYFORMULA(IF(LEN(IMPORTRANGE(Sheet1!C3; Sheet1!D3 & "!A3:Q")); "Location2"; ""))
};"SELECT * WHERE Col16 > 0 ")
“位置1”和“位置2”不显示。
我想要这样的东西
A-Q 列 | R 列 |
---|---|
(来自导入范围 Sheet1!C2) | 地点1 |
(来自导入范围 Sheet1!C3) | 地点2 |
=QUERY({
IMPORTRANGE(Sheet1!C2, "Sheet1!A1:Q1"), "Location 1";
IMPORTRANGE(Sheet1!C2, "Sheet1!A2:Q2"), "Location 2"
}, "SELECT *")
={
IMPORTRANGE(Sheet1!C2, "Sheet1!A1:Q1"), "Location 1";
IMPORTRANGE(Sheet1!C2, "Sheet1!A2:Q2"), "Location 2"
}
=VSTACK({IMPORTRANGE(Sheet1!C2, "Sheet1!A1:Q1"),"Location 1"},{IMPORTRANGE(Sheet1!C2, "Sheet1!A2:Q2"), "Location 2"})
请注意,这些公式基于您现有的进度。考虑到您希望对值进行硬编码(位置 1、位置 2),如果您希望其是动态的,则需要包含其他函数来执行此操作。