根据另一行中的值获取平均值 [英] Get average based on value in another row

查看:131
本文介绍了根据另一行中的值获取平均值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个这样的Excel文件中的值:

I have values in an Excel file like this:

QR  |  QR AVG  |  val1  |
q1                5
q1                3
q1                4
q2                7
q2                9
q3                10
q3                11
q3                12
q3                11
q4                5
q5                5
q5                7

我想要QR AVG字段表示由不同的QR值分割的平均值。换句话说,我想在我的计算后有以下值:

And I would like the QR AVG field to represent the average value partitioned by different QR values. In other words, I'd like to have the following values after my calculation:

QR  |  QR AVG  |  val1  |
q1     4          5
q1     4          3
q1     4          4
q2     8          7
q2     8          9
q3     11         10
q3     11         11
q3     11         12
q3     11         11
q4     5          5
q5     6          5
q5     6          7

我不知道我将具有的确切行数,我将间歇性地将行随机添加到表中。

Where I don't know the exact number of rows that I will have, and I will be intermittently adding rows randomly into the table.

如果可能,我不想写一个宏来做这个。任何想法我可能会这么做?

I would prefer not to write a macro to do this if possible. Any idea how I might go about this?

推荐答案

尝试这样:
= AVERAGEIF($ A $ 2:$ A $ 13,A2,$ C $ 2:$ C $ 13)

Try this: =AVERAGEIF($A$2:$A$13,A2,$C$2:$C$13)

应该在每个单元格的B列(QR平均)中。当然,中间的参数会自动更改。

That should go in column B (QR Average) in each cell. The middle param will automatically change, of course.

这篇关于根据另一行中的值获取平均值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆