简体   繁体   English

在Excel中计算单元格中数组结果的AVERAGE

[英]In Excel calculate AVERAGE of an array result which in a cell

I have the below formula that Lookup the A1:A10 appropriated Score Number. 我有以下公式,用于查找A1:A10合适的分数。

{=INDEX(Table1[ScoreNum],MATCH(A1:A10,Table1[ScoreWord],0))}

I need calculate the AVERAGE result of this entire array. 我需要计算整个数组的平均结果。

But when using this: 但是当使用这个:

{=AVERAGE(INDEX(Table1[ScoreNum],MATCH(A1:A10,Table1[ScoreWord],0)))}

Returns the first looked up result with Index/Match, against returns the average of all returnable values whit this array formula. 返回带有索引/匹配的第一个查找结果,反对返回此数组公式中所有可返回值的平均值。

How can do that? 那怎么办


The sample Workbook file 示例工作簿文件

Sheet1 工作表1

Sheet1图片

Sheet2: Table1 表格2:表1

Sheet2图片

Note: The formula in B11 is: =AVERAGE(B1:B10) and returns the true value. 注意: B11的公式为: =AVERAGE(B1:B10)并返回真实值。 I need return this without using the B helper column, directly in a single cell ( A11 ) with the true form of formula shows in the picture. 我需要不使用B helper列而直接在单个单元格( A11 )中返回它,并在图中显示公式的真实形式。

Very truly yours. 真的是你的。

I would use, instead, this array-formula : 我将使用以下数组公式

=AVERAGE(AVERAGEIF(Table1[Column1],A1:A10,Table1[Column2]))

To enter/confirm an array formula , hold down ctrl + shift while hitting enter . 要输入/确认数组公式 ,请在按Enter的同时按住ctrl + shift If you do this correctly, Excel will place braces {...} around the formula seen in the formula bar. 如果正确执行此操作,Excel会将括号{...}放在在公式栏中看到的公式周围。

The AVERAGEIF function returns the array {1;0.8;1;0.2;0.6;0.8;1;1;0.6;0.2} which is what you are showing in your column B in your screenshot. AVERAGEIF函数返回数组{1;0.8;1;0.2;0.6;0.8;1;1;0.6;0.2} ,这是您在屏幕快照的B列中显示的内容。

We then AVERAGE that array by nesting the AVERAGEIF(.. within the AVERAGE function. 然后,我们AVERAGE通过嵌套数组AVERAGEIF(..在中AVERAGE函数。

Another method: 另一种方法:

=AVERAGE(INDEX(Table1[Column2],N(IF({1},MATCH(A1:A10,Table1[Column1],0)))))

also entered as an array formula. 也作为数组公式输入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM