根据客户ID计算3个月的平均值

时间:2019-07-08 20:07:03

标签: excel excel-formula

我正在尝试计算excel中三个月的平均销售额,而excel中的customerid。我尝试通过averageIfs函数执行此操作,但没有任何帮助。

A              B         C
Orderdate      sales    customerid
5/15/2019        7           1
5/15/2019        48.5        1
4/15/2019       92.94        1
3/17/2019     102.85         1
3/18/2019      49            1
3/18/2019     119.95         1
2/18/2019     58.96          1
1/20/2019      14.6         1
5/16/2019      17           6
4/15/2019     148.5         6
4/12/2019    912.94         6
3/17/2019   102.85          6
9/18/2018    22.34          6

Formula I tried: =AVERAGEIFS(B:B,C:C,C2)

预期输出:

customerid      average(3 months)
1                    49.48         
6                   359.48

1 个答案:

答案 0 :(得分:0)

让我们从今天的日期和3个月前的日期开始(使其充满活力):

请记住将单元格格式从“常规”更改为“日期”。否则,它将显示[43563]

enter image description here

接下来将日期用作过滤器的一部分

enter image description here

enter image description here

现在,您应该获得最近3个月的数据:

enter image description here


将过滤后的数据复制到新的电子表格

将过滤后的数据复制到新的电子表格

将过滤后的数据复制到新的电子表格


下一步:获取唯一的客户ID: enter image description here enter image description here

您将获得:

enter image description here

最后一步:

使用功能“ AVERAGEIF”:

enter image description here

完成!

相关问题