如何计算特定日期的客户数量

时间:2019-05-19 21:14:22

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

我有这个样本表

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

我需要的是从日期的“ V”标签和“ Ventas”标签中统计客户端的数量: 今天,昨天,过去30天,本月,上个月,去年本月

我需要在“统计信息”标签中显示结果

对此有任何帮助吗?

1 个答案:

答案 0 :(得分:1)

enter image description here

D4:

=COUNTA(IFERROR(UNIQUE(FILTER({V!B4:B;Ventas!B4:B}, {V!A4:A;Ventas!A4:A}=TODAY()))))

D5:

=COUNTA(IFERROR(UNIQUE(FILTER({V!B4:B;Ventas!B4:B}, {V!A4:A;Ventas!A4:A}=TODAY()-1))))

D6:

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

D7:

=COUNTA(IFERROR(UNIQUE(FILTER({V!B4:B;Ventas!B4:B}, 
 YEAR({V!A4:A;Ventas!A4:A})=YEAR(TODAY()), 
 MONTH({V!A4:A;Ventas!A4:A})=MONTH(TODAY())))))

D8:

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

D9:

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