基于多列标准的求平均值

问题描述 投票:1回答:1

我有一个电子表格,其中包含我们组织中数百名领导者的评分数据。使用VBA,我想找到每个领导者在每个问题上的平均评分。示例:

我的数据是以下格式

-Name      Question      Rating
-John      Q1            4 
-John      Q1            2
-John      Q2            3
-John      Q2            2
-Heather   Q1            5
-Heather   Q1            3
-Heather   Q2            3
-Heather   Q2            1

我想根据此数据获得以下结果。

John
 Q1 Average 3
 Q2 Average 2.5
Heather
 Q1 Average 4
 Q2 Average 2

希望这很清楚。我对VBA有点陌生,因此感谢您的帮助!

excel vba
1个回答
1
投票

我第二次是Lisa对数据透视表的建议。当Excel具有开箱即用的功能来执行您想要的操作时,不需要自定义VBA代码。

PivotTable example

© www.soinside.com 2019 - 2024. All rights reserved.