I am trying to get this done with a single array formula:
For row in a column array, if the array row tests positive for a condition, calculate the average of the next N rows in a different array of equal size. Each of these averages would be placed in an array, and then the average of this array would be taken.
This is the most promising thing I've been able to come up with so far:
=AVERAGE(AVERAGE(INDIRECT(IF($G$1:$G$16=2,CONCATENATE("AVERAGE(",ADDRESS(ROW($H$1:$H$16)+1,COLUMN($H$1:$H$16)),":",ADDRESS(ROW($H$1:$H$16)+2,COLUMN($H$1:$H$16)),")"),""))))
It puts the text of: average of the proper sub array I want to calculate.
But I am trying to get the actual values instead of the text. Or alternatively if there is an easier/smarter way to do this I am open to that as well.
Any help is much appreciated.
For row in a column array, if the array row tests positive for a condition, calculate the average of the next N rows in a different array of equal size. Each of these averages would be placed in an array, and then the average of this array would be taken.
This is the most promising thing I've been able to come up with so far:
=AVERAGE(AVERAGE(INDIRECT(IF($G$1:$G$16=2,CONCATENATE("AVERAGE(",ADDRESS(ROW($H$1:$H$16)+1,COLUMN($H$1:$H$16)),":",ADDRESS(ROW($H$1:$H$16)+2,COLUMN($H$1:$H$16)),")"),""))))
It puts the text of: average of the proper sub array I want to calculate.
But I am trying to get the actual values instead of the text. Or alternatively if there is an easier/smarter way to do this I am open to that as well.
Any help is much appreciated.