Average of a filter of multiple columns in Excel

时光怂恿深爱的人放手 提交于 2020-01-02 16:44:07

问题


I would like a formula to display the average of a number of filtered values in Excel. For example, in column A I have the year, in column B I have the month, and in column C I have the values.

So I would like to select the 2011 year, the month of May and get the average of the values in column C that satisfy these requirements. I'm thinking a function like...

=AVERAGE(IF(AND($A$1:$A:$100=2011,$B$1:$B:$100=May),$C$1:$C:$100))

But I don't think this will work, and I've tried it.


回答1:


Use the AverageIfs function. e.g.

AVERAGEIFS(C1:C100,A1:A100,"=2011",B1:B100,"=May")




回答2:


You can use SUMIF or SUMPRODUCT:

=AVERAGE(SUMIF($C$1:$C:$100,$A$1:$A:$100,2011,$B$1:$B:$100,"May"))

Edit: I think the solution by atov is better. Meh. Still works :)



来源:https://stackoverflow.com/questions/11826376/average-of-a-filter-of-multiple-columns-in-excel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!