我是在这里问问题的新手,所以我希望我正确。我正在用电子表格帮助我的父亲,但在弄清楚如何做一个公式时遇到了问题。不知道它是否可以通过公式来完成,或者是否必须通过宏来完成。
这是具有多个匹配项的得分表。每场比赛都有一个总得分,得分旁边的单元格是X计数(牛眼数)。在同一行(第K列)中,我计算了前6个总分并将其平均:
= AVERAGE(LARGE((N15,Q15,T15,W15,Z15,AC15,AF15,AI15,AL15,AO15,AR15,AU15,AX15,BA15,BD15,BG15,BJ15),{1,2,3,4, 5,6}))
现在,我需要获取上面公式中使用的总得分旁边的X计数的AVG,并将解决方案放在L列中。
例如,如果该行中用于AVG评分的单元格为:
N15,Q15,T15,W15,Z15,AC15
那么需要用于X计数AVG的单元格将是:
O15,R15,U15,X15,AA15,AD15
该结果将被放入 L15
请帮忙。如果需要任何澄清,请告诉我。
截屏:
请尝试以下公式:
=SUMPRODUCT(O15:BM15,
--(MOD(COLUMN(N15:BL15)-COLUMN($N15),3)=0),
--(N15:BL15+O15:BM15/10^3+COLUMN(N15:BL15)/10^6>=
LARGE(N15:BL15+O15:BM15/10^3+COLUMN(N15:BL15)/10^6,6))
)/6
它是如何工作的?
SUMPRODUCT
有3个参数-第一个是要求和的数组,接下来的2个参数返回的数组,0
并1
仅选择第一个数组中有趣的元素。
MOD(COLUMN(N15:BL15)-COLUMN($N15),3)=0)
This part is included to avoid listing every single cell. If the score is in every third column of the input range, we can calculate column number relative to first column, and function MOD(column,3) returns: {1,0,0,1,0,0...}
. So only every third column of input array will be included in sum.
(N15:BL15+O15:BM15/10^3+COLUMN(N15:BL15)/10^6>= LARGE(N15:BL15+O15:BM15/10^3+COLUMN(N15:BL15)/10^6,6)
This part is to decide which 6 of the scores should be included in the final sum. The trickiest part is to decide what to do with ties. My approach is to take:
This means that instead of N15
value we calculate:
N15+O15/10^3+COLUMN(N15)/10^6
With your sample data it evaluates to: 566.017014
. First three decimal places is the number of bulleyes, next 3 is column number.
You can use the same formula to calculate average of top 6 scores by changing the first parameter:
=SUMPRODUCT(N15:BL15,
--(MOD(COLUMN(N15:BL15)-COLUMN($N15),3)=0),
--(N15:BL15+O15:BM15/10^3+COLUMN(N15:BL15)/10^6>=
LARGE(N15:BL15+O15:BM15/10^3+COLUMN(N15:BL15)/10^6,6))
)/6
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句