如果两个条件一起出现,我使用谷歌工作表查询和子查询来获取列(Col3)中的单元格总和:
到目前为止,我使用查询来选择数据,我正在尝试使用子查询来对所需值求和
如截图所示:
相反A79:H86
你将从你的图像中提出你的查询,然后调整G79:G86
以适应虚拟数组结构,并调整{2,9}
添加更多列(如那些隐藏的列)然后,当然,如果你在Cols
添加更多的东西,调整{2,9}
=ARRAYFORMULA(QUERY({IFERROR(VLOOKUP(QUERY(QUERY(
{A79:H86},"select Col7, sum(Col3) group by Col7 label sum(Col3)''",0),
"select Col1",0),{G79:G86,A79:H86},{2,9},0), ),
QUERY({A79:H86},"select Col7, sum(Col3) group by Col7 label sum(Col3)''",0),
QUERY({A79:H86},"select sum(Col4) group by Col7 label sum(Col4)''",0)},
"select Col1, Col4, Col5, Col3, Col2 order by Col2",0))
只汇总Col3:
=ARRAYFORMULA(QUERY({IFERROR(VLOOKUP(QUERY(QUERY(
{A79:H86},"select Col7, sum(Col3) group by Col7 label sum(Col3)''",0),
"select Col1",0),{G79:G86,A79:H86},{2,9},0), ),
QUERY({A79:H86},"select Col7, sum(Col3) group by Col7 label sum(Col3)''",0)},
"select Col1, Col4, Col3, Col2 order by Col2",0))