I was tasked with creating a rolling average column which compares one row to it's exact matches from the last three months (each month has it's own sheet).
Currently, my (beginners) work looks like this:
AD3 AD4 and AD5 are the name of the tabs, e.g. MAY 2022
Row 7 happens to be the row that is looking to be matched on the other sheets.
=AVERAGE(
IFERROR(AVERAGEIFS(
INDIRECT($AD$3&"!$K$3:$K$500"),
INDIRECT($AD$3&"!$B$3:$B$500"),$B7,
INDIRECT($AD$3&"!$D$3:$D$500"),$D7,
INDIRECT($AD$3&"!$E$3:$E$500"),$E7,
INDIRECT($AD$3&"!$F$3:$F$500"),$F7),0),
IFERROR(AVERAGEIFS(
INDIRECT($AD$4&"!$K$3:$K$500"),
INDIRECT($AD$4&"!$B$3:$B$500"),$B7,
INDIRECT($AD$4&"!$D$3:$D$500"),$D7,
INDIRECT($AD$4&"!$E$3:$E$500"),$E7,
INDIRECT($AD$4&"!$F$3:$F$500"),$F7),0),
IFERROR(AVERAGEIFS(
INDIRECT($AD$5&"!$K$3:$K$500"),
INDIRECT($AD$5&"!$B$3:$B$500"),$B7,
INDIRECT($AD$5&"!$D$3:$D$500"),$D7,
INDIRECT($AD$5&"!$E$3:$E$500"),$E7,
INDIRECT($AD$5&"!$F$3:$F$500"),$F7),0)
)
This works, but if one value is 0, I'd like it to be ignored for the average, which doesn't seem possible with the AVERAGE and AVERAGEIFS functions I'm using. So my question is twofold, is there a simpler way I could be doing this, and how can ignore 0 so it doesn't bring down my average?
Thanks.