提取工作表中的交替值以计算平均值 [英] Extracting alternating values across worksheet in order to calculate average

查看:28
本文介绍了提取工作表中的交替值以计算平均值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从交替的行中提取值直到指定的上限,以计算平均值.到目前为止,我有以下代码:

I would like to extract values from alternating rows up to a specified upper limit in order to calculate the average. So far, I have the following code:

mainWorkBook.Worksheets(avgsheetNames(i)).Range("C2:H32").Formula = "=SUM(INDEX(Aggregated_Internal_Scores!I:I,(ROW($ZZ1)-1)*6+2):INDEX(Aggregated_Internal_Scores!I:I,(ROW($ZZ1)-1)*6+7))/6"

但是,我想对此进行修改,以便在 I2 I7 的范围内, I2 I4中的值获得 I6 进行进一步的计算.希望能够将其应用于指定的"C2:H32" 范围.
任何帮助或见识将不胜感激.

However, I would like to modify this so that in the range of I2 to I7 the values from I2, I4 and I6 are obtained for further calculations. It would be desirable to be able to apply this to the range as specified "C2:H32".
Any help or insight would be greatly appreciated.

推荐答案

如果不是Office 365:

If non Office 365:

mainWorkBook.Worksheets(avgsheetNames(i)).Range("C2:H32").FormulaArray = "=SUM(INDEX(INDEX(Sheet1!I:I,(ROW($ZZ1)-1)*6+2):INDEX(Sheet1!I:I,(ROW($ZZ1)-1)*6+7),N(IF({1},{1,3,5}))))/3"

Office 365:

Office 365:

mainWorkBook.Worksheets(avgsheetNames(i)).Range("C2:H32").Formula2 = "=SUM(INDEX(Aggregated_Internal_Scores!I:I,SEQUENCE(3,,(ROW($ZZ1)-1)*6+2,2))/3"

这篇关于提取工作表中的交替值以计算平均值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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