我想使用循环或ARRAYFORMULA概括如下的查询集(正在运行)。但是我不能成功。在下面的示例中,循环必须在[其中F ='“&G7&”']上进行,其中G7到达G8,G9,等等。...对于相同的引用有2个连续的查询。最后,所有查询都应在列表{}中,以便结果一个接一个。有人可以帮忙吗?
={query(notes;"select G,F,H,D,E where F='" & G7 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G7 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G8 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G8 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G9 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G9 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G10 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G10 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G11 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G11 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G12 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G12 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G13 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G13 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G14 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G14 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G15 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G15 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G16 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G16 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0);
query(notes;"select G,F,H,D,E where F='" & G17 &"' and A='" & C3 &"' order by H";0);query(notes;"select G, F, M, avg(C), sum(E) where F='" & G17 &"' and A='" & C3 &"' group by G,F,M label avg(C) '', sum(E) '', G '', F '', M ''";0)}