For my formulas to work, the SUBTOTAL function would have to be used in A4, A7, A11, etc., to get your subtotals. Since that probably isn't the case, you could replace the first formula I offered with the following...
=SUMPRODUCT(A1:A18,--ISNUMBER(MATCH(ROW(A1:A18),{4,7,11,15,18},0)))/SUMPRODUCT(--(A1:A18>0),--ISNUMBER(MATCH(ROW(A1:A18),{4,7,11,15,18},0)))
OR
=SUMPRODUCT(A1:A18,--ISNUMBER(MATCH(ROW(A1:A18),B1:B5,0)))/SUMPRODUCT(--(A1:A18>0),--ISNUMBER(MATCH(ROW(A1:A18),B1:B5,0)))
...where B1:B5 contains a list of rows to average, such as...
4
7
11
15
18
However, if each subtotal cell is labelled with the word 'Subtotal' in the column next to it, let's say Column B, try one of the following formulas instead...
If the word 'Subtotal' is the only word that appears in the cell:
=AVERAGE(IF((A1:A18>0)*(B1:B18="Subtotal"),A1:A18))
If the word 'Subtotal' is the first word that appears in the cell:
=AVERAGE(IF((A1:A18>0)*(LEFT(B1:B18,8)="Subtotal"),A1:A18))
If the word 'Subtotal' can appear anywhere in the cell within the text string:
=AVERAGE(IF((A1:A18>0)*(ISNUMBER(SEARCH("Subtotal",B1:B18))),A1:A18))
These formulas need to be confirmed with CONTROL+SHIFT+ENTER.
Hope this helps!
Bookmarks