我想将此查询用作数组公式
I want to use this query as an arrayformula
任何人都可以向我建议如何将此查询转换为可在数组公式中使用的内容吗?
=iferror(QUERY(importorders!A:H,"Select count(A) where C = 'Thailand Tour' and month(H) = "&MONTH(A3)-1&"and year(H) = "&year(A3)&" label count(A) ''",1),0)
基本上就是统计我每个月有多少订单。
感谢观看。
View sheet (image)
你必须使用group by
只为 Thailand Tour
=iferror(QUERY(importorders!A:H,"Select count(A) where C = 'Thailand Tour' and month(H) = "&MONTH(A3)-1&"and year(H) = "&year(A3)&" group by C label count(A) ''",1),0)
要获得整个专栏的结果试试这个
=iferror(QUERY(importorders!A:H,"Select count(A) where month(H) = "&MONTH(A3)-1&"and year(H) = "&year(A3)&" group by C label count(A) ''",1),0)
(具有预期结果的演示 sheet 会很有帮助)
尝试:
=ARRAYFORMULA(IFNA(VLOOKUP(A3:A, QUERY({importorders!A2:C,
EOMONTH(importorders!H2:H, -1)+1},
"select Col4,count(Col1)
where Col3 = 'Thailand Tour'
and Col4 is not null
group by Col4
label count(Col1)''", 0), 2, 0), 0))
任何人都可以向我建议如何将此查询转换为可在数组公式中使用的内容吗?
=iferror(QUERY(importorders!A:H,"Select count(A) where C = 'Thailand Tour' and month(H) = "&MONTH(A3)-1&"and year(H) = "&year(A3)&" label count(A) ''",1),0)
基本上就是统计我每个月有多少订单。
感谢观看。
View sheet (image)
你必须使用group by
只为 Thailand Tour
=iferror(QUERY(importorders!A:H,"Select count(A) where C = 'Thailand Tour' and month(H) = "&MONTH(A3)-1&"and year(H) = "&year(A3)&" group by C label count(A) ''",1),0)
要获得整个专栏的结果试试这个
=iferror(QUERY(importorders!A:H,"Select count(A) where month(H) = "&MONTH(A3)-1&"and year(H) = "&year(A3)&" group by C label count(A) ''",1),0)
(具有预期结果的演示 sheet 会很有帮助)
尝试:
=ARRAYFORMULA(IFNA(VLOOKUP(A3:A, QUERY({importorders!A2:C,
EOMONTH(importorders!H2:H, -1)+1},
"select Col4,count(Col1)
where Col3 = 'Thailand Tour'
and Col4 is not null
group by Col4
label count(Col1)''", 0), 2, 0), 0))