AHA! Great success! I suspected that the discrepancy might have to do with your excellent code's handling of blank cells. We have Q1 data for 2012, but nothing for the other quarters (they're blank). The formula handles these blanks differently from the =AVERAGE(B3,B7,B11,15,...), such that simply adding zeroes to the blank cells cured the problem. If there is a smarter way to do it, I'd love to know.
Incidentally, it took me a while to piece together what your code was doing. I'm still not certain if there's a principle behind doing it as you did
=AVERAGE(IF(MOD(ROW(B$2:B$20)-2,4)+1=1,B$2:B$20)
instead of like this
=AVERAGE(IF(MOD(ROW(B$2:B$20)-2,4)=0,B$2:B$20)
for Q1, like this
=AVERAGE(IF(MOD(ROW(B$2:B$20)-2,4)=2,B$2:B$20)
for Q2, and so on. It seems to work without the +1 if you step the =x down commensurately, but using it that way does make adjusting the =1, =2, =3, and =4 for Q1, Q2, Q3, and Q4 more "parallel". However, it certainly didn't make it more intuitive to understand the code--but I am slow, and just learning how to do these things.
Thanks again for your very useful help.
As an aside, I just discovered that it also works to use a "search" type feature, since all of my data points have a Q1-Q4 row designation. It looks like this:
{=AVERAGE(IF($Q$3=$B$3:$B$86,$I$3:$I$86))}
This method might be more flexible for applications when one is moving or sorting the data, as it works independently of the row number. Still requires Ctrl-Shift-Enter to set it as an array formula.
Bookmarks