How to average every nth column in Excel?

被刻印的时光 ゝ 提交于 2021-02-20 03:35:33

问题


I've looked around on Google for answer to this question, but most websites only show how to average or sum every nth row (although I imagine they're related). I've tried using various formulas I could find for columns, but I haven't been successful. (Admittedly, my Excel skills aren't very sophisticated.)

I want to get the average of every 6th column in my dataset. There are a ton of columns that need averaging, so if there's some formula that could aid with this, that would be great!

As an example of the kind of data I'm working with, see below. Basically, I have many columns, each with many rows (119) and all of them contain empty values. I want to average, for example, Q1 (=10.68) and Q7 (=16), and so on.

Thanks!


回答1:


Something similar to this array formula:

=AVERAGE(IF((MOD(COLUMN($A$2:$R$12)-1,6)=0)*($A$2:$R$12<>""),$A$2:$R$12))

Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when leaving edit mode. If done correctly then Excel will put {} around the formula.

You may need to adjust the math to get the correct column:




回答2:


i think the following should work.

Here is what you need: 1. SUMIF to get the sum of every 6th column 2. COUNTIF to get the number of columns 3. A "help row" to check if the column is a 6th one.

Assuming the first column you want to use is the 6th, every 6th column X has

MOD(COLUMNS(X),6)=0

So add a "help row" with the formula

=IF(MOD(COLUMNS("YOUR CELL");6)=0;1;0)

The average your looking for is

=SUMIF("HELP ROW";1;"YOUR CELLS")/COUNTIF("HELP ROW";1)



来源:https://stackoverflow.com/questions/37948444/how-to-average-every-nth-column-in-excel

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