July 11, 2017
Hi
The following formula finds the average of the selected weeks, but I want the average to exclude weeks that are zero?
=AVERAGE(INDIRECT(ADDRESS(ROW(),MATCH($V$1,$2:$2,0),3,1),1):INDIRECT(ADDRESS(ROW(),MATCH($W$1,$2:$2,0),3,1),1))
Any help greatly appreciated.
Thanks Paul
July 16, 2010
What version of Excel are you working with, Paul? Hopefully 365.
If you have 365 for Group 1:
=IFERROR(AVERAGE(FILTER(F257:S257,($F$256:$S$256>=$V$1)*($F$256:$S$256<=$W$1)*F257:S2570)),"")
If you have Excel 2019 or earlier for Group 1:
=IFERROR(SUMPRODUCT(G257:S257*($G$256:$S$256>=$V$1)*($G$256:$S$256<=$W$1)*(G257:S2570))/SUMPRODUCT(($G$256:$S$256>=$V$1)*($G$256:$S$256<=$W$1)*(G257:S2570)),"")
Note: You should avoid using INDIRECT at all costs.
Mynda
Answers Post
July 16, 2010
INDIRECT is a volatile function, which can put enormous strain on Excel's calc engine resulting in slow workbooks. Volatile functions recalculate almost every time anything in your workbook changes, as opposed to only calculating when cells the formula is dependent on change, like regular functions. For that reason I only use it as a last resort, especially if the formula is going to occupy many cells.
1 Guest(s)