有人可以建议我如何将查询转换为可以在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)
基本上只是在计算我每个月有多少订单。
感谢您的光临。
答案 0 :(得分:0)
您必须使用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)
(具有预期结果的演示文稿会很有帮助)
答案 1 :(得分:0)