[英]Calculate Daily Average Sales for top 3 products based on multiple conditions
I have an excel product sales table looking like this (last column is empty, i've just populated the result I'm looking to calculate):我有一个 excel 产品销售表,看起来像这样(最后一列是空的,我刚刚填充了我要计算的结果):
Date![]() |
Sales![]() |
Retailer![]() |
ProductName![]() |
ProductType![]() |
Top 3 daily AVG Sales![]() |
---|---|---|---|---|---|
01/01/2021 ![]() |
1000 ![]() |
Retailer 1![]() |
Product 1![]() |
Mobile![]() |
2100 ![]() |
01/01/2021 ![]() |
2000 ![]() |
Retailer 1![]() |
Product 2![]() |
Desktop![]() |
|
01/01/2021 ![]() |
700 ![]() |
Retailer 1![]() |
Product 3![]() |
Desktop![]() |
|
01/01/2021 ![]() |
1250 ![]() |
Retailer 1![]() |
Product 4![]() |
Mobile![]() |
2100 ![]() |
01/01/2021 ![]() |
2200 ![]() |
Retailer 1![]() |
Product 5![]() |
Mobile![]() |
2100 ![]() |
01/01/2021 ![]() |
1700 ![]() |
Retailer 1![]() |
Product 6![]() |
Desktop![]() |
|
01/01/2021 ![]() |
2700 ![]() |
Retailer 1![]() |
Product 7![]() |
Mobile![]() |
2100 ![]() |
01/01/2021 ![]() |
1400 ![]() |
Retailer 1![]() |
Product 8![]() |
Mobile![]() |
2100 ![]() |
01/01/2021 ![]() |
1200 ![]() |
Retailer 1![]() |
Product 9![]() |
Desktop![]() |
|
01/01/2021 ![]() |
1650 ![]() |
Retailer 1![]() |
Product 10![]() |
Desktop![]() |
|
01/01/2021 ![]() |
1200 ![]() |
Retailer 2![]() |
Product 1![]() |
Mobile![]() |
|
01/01/2021 ![]() |
1000 ![]() |
Retailer 2![]() |
Product 2![]() |
Desktop![]() |
|
01/01/2021 ![]() |
600 ![]() |
Retailer 2![]() |
Product 3![]() |
Desktop![]() |
|
01/01/2021 ![]() |
2250 ![]() |
Retailer 2![]() |
Product 4![]() |
Mobile![]() |
|
01/01/2021 ![]() |
1450 ![]() |
Retailer 2![]() |
Product 5![]() |
Mobile![]() |
|
01/01/2021 ![]() |
1600 ![]() |
Retailer 2![]() |
Product 6![]() |
Desktop![]() |
|
01/01/2021 ![]() |
1700 ![]() |
Retailer 2![]() |
Product 7![]() |
Mobile![]() |
|
01/01/2021 ![]() |
1800 ![]() |
Retailer 2![]() |
Product 8![]() |
Mobile![]() |
|
01/01/2021 ![]() |
1300 ![]() |
Retailer 2![]() |
Product 9![]() |
Desktop![]() |
|
01/01/2021 ![]() |
1100 ![]() |
Retailer 2![]() |
Product 10![]() |
Desktop![]() |
|
01/02/2021 ![]() |
1000 ![]() |
Retailer 1![]() |
Product 1![]() |
Mobile![]() |
|
01/02/2021 ![]() |
2000 ![]() |
Retailer 1![]() |
Product 2![]() |
Desktop![]() |
|
01/02/2021 ![]() |
700 ![]() |
Retailer 1![]() |
Product 3![]() |
Desktop![]() |
|
01/02/2021 ![]() |
1250 ![]() |
Retailer 1![]() |
Product 4![]() |
Mobile![]() |
|
01/02/2021 ![]() |
2200 ![]() |
Retailer 1![]() |
Product 5![]() |
Mobile![]() |
|
01/02/2021 ![]() |
1700 ![]() |
Retailer 1![]() |
Product 6![]() |
Desktop![]() |
|
01/02/2021 ![]() |
2700 ![]() |
Retailer 1![]() |
Product 7![]() |
Mobile![]() |
|
01/02/2021 ![]() |
1400 ![]() |
Retailer 1![]() |
Product 8![]() |
Mobile![]() |
|
01/02/2021 ![]() |
1200 ![]() |
Retailer 1![]() |
Product 9![]() |
Desktop![]() |
|
01/02/2021 ![]() |
1650 ![]() |
Retailer 1![]() |
Product 10![]() |
Desktop![]() |
|
01/02/2021 ![]() |
1200 ![]() |
Retailer 2![]() |
Product 1![]() |
Mobile![]() |
|
01/02/2021 ![]() |
1000 ![]() |
Retailer 2![]() |
Product 2![]() |
Desktop![]() |
|
01/02/2021 ![]() |
600 ![]() |
Retailer 2![]() |
Product 3![]() |
Desktop![]() |
|
01/02/2021 ![]() |
2250 ![]() |
Retailer 2![]() |
Product 4![]() |
Mobile![]() |
|
01/02/2021 ![]() |
1450 ![]() |
Retailer 2![]() |
Product 5![]() |
Mobile![]() |
|
01/02/2021 ![]() |
1600 ![]() |
Retailer 2![]() |
Product 6![]() |
Desktop![]() |
|
01/02/2021 ![]() |
1700 ![]() |
Retailer 2![]() |
Product 7![]() |
Mobile![]() |
|
01/02/2021 ![]() |
1800 ![]() |
Retailer 2![]() |
Product 8![]() |
Mobile![]() |
|
01/02/2021 ![]() |
1300 ![]() |
Retailer 2![]() |
Product 9![]() |
Desktop![]() |
|
01/02/2021 ![]() |
1100 ![]() |
Retailer 2![]() |
Product 10![]() |
Desktop![]() |
In the Top 3 daily AVG Sales column I'm looking to write a formula that calculates the average top 3 sales for each day per Retailer and Product Type.在前 3 名每日平均销售额列中,我希望编写一个公式来计算每个零售商和产品类型每天的平均前 3 名销售额。 So, if date is 01/01/2021 and Retailer is Retailer 1 and ProductType is Mobile, find the top 3 sales and average them => (2200+2700+1400)/3 = 2100
因此,如果日期是 01/01/2021,Retailer 是 Retailer 1,ProductType 是 Mobile,则找出前 3 名的销售额并取平均值 => (2200+2700+1400)/3 = 2100
Appreciate any help with this.感谢您对此的任何帮助。
You can try-你可以试试-
=AVERAGE(INDEX(SORT(FILTER($B$3:$B$42,($A$3:$A$42=A3)*($C$3:$C$42=C3)*($E$3:$E$42=E3)),,-1),{1,2,3}))
Edit: Try below array formula for non
O365
excels.编辑:尝试以下非
O365
擅长的数组公式。 Must be enters nuCTRL+SHIFT+ENTER
.必须输入 nu
CTRL+SHIFT+ENTER
。
=AVERAGE(LARGE(IF(($A$2:$A$42=A2)*($C$2:$C$42=C2)*($E$2:$E$42=E2),$B$2:$B$42,""),{1,2,3}))
Press CTRL + SHIFT + ENTER to evaluate the formula as it is an array formula.按CTRL + SHIFT + ENTER计算公式,因为它是一个数组公式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.