Try the below. Please note that this is an array formula. Within the cell in
edit mode (F2) paste this formula and press Ctrl+Shift+Enter to apply this
formula. If successful in 'Formula Bar' you can notice the curly braces at
both ends like "{=<formula>}"
=AVERAGE(IF(TEXT(B1:B100,"mm")="07",D1
100))
If you want to ignore blanks and zeroes try the below version
=AVERAGE(IF(TEXT(B1:B100,"mm")="07",IF(D1
100>0,D1
100)))
If this post helps click Yes