如何从某些日期列表中计算订单数

时间:2019-05-20 02:12:45

标签: filter google-sheets google-sheets-formula

我有这个样本表

https://docs.google.com/spreadsheets/d/1-Zr1ij6KbKbL5IHrVYBNPWmWSWkntZz9amrNBInQY6c/edit?usp=sharing

我需要计算两个标签中特定日期的订单数量:今天,昨天,过去30天,本月,上个月,去年本月

显示“统计信息”标签

该如何解决?

1 个答案:

答案 0 :(得分:1)

0

F4:

=COUNTA(IFERROR(FILTER({V!D4:D;Ventas!D4:D}, {V!A4:A;Ventas!A4:A}=TODAY())))

F5:

=COUNTA(IFERROR(FILTER({V!D4:D;Ventas!D4:D}, {V!A4:A;Ventas!A4:A}=TODAY()-1)))

F6:

=COUNTA(IFERROR(FILTER({V!D4:D;Ventas!D4:D}, {V!A4:A;Ventas!A4:A}<=TODAY(), 
 {V!A4:A;Ventas!A4:A}>=TODAY()-30)))

F7:

=COUNTA(IFERROR(FILTER({V!D4:D;Ventas!D4:D}, 
 YEAR({V!A4:A;Ventas!A4:A})=YEAR(TODAY()), 
 MONTH({V!A4:A;Ventas!A4:A})=MONTH(TODAY()))))

F8:

=COUNTA(IFERROR(FILTER({V!D4:D;Ventas!D4:D}, 
 YEAR({V!A4:A;Ventas!A4:A})=YEAR(TODAY()), 
 MONTH({V!A4:A;Ventas!A4:A})=MONTH(TODAY())-1)))

F9:

=COUNTA(IFERROR(FILTER({V!D4:D;Ventas!D4:D}, 
 YEAR({V!A4:A;Ventas!A4:A})=YEAR(TODAY())-1, 
 MONTH({V!A4:A;Ventas!A4:A})=MONTH(TODAY()))))