Good afternoon,
I am using the following formula to calculate the average of a dynamic range. The range should be the range that contains the next 3 values in a list > 0 (Range could be higher than 3 if there are 0s).
=AVERAGEIF(OFFSET(ED75:ED75,0,0,AGGREGATE(15,6,((ROW(ED75:$ED$171)-ROW()+1-48)/ED75:$ED$171)*(ED75:$ED$171),3)),"<>0")
The formula is properly working in majority of the cells but it doesn't in some random cells. The problem is that it doesn't take the proper height, but height-1.
When I evaluate it, the result of the aggregate function which is the height is ok (image 1.) but the next evaluate doesn't dimension the range to 3 but to 2.
Thanks in advance, Almudena