You have a space following the value in O14 ("Oct ").
Delete the space and you'll get 8.5. You can also shorten your formula to ...
=SUMPRODUCT(--(TEXT(D3:D25,"MMM")=O5),M3:M25)/SUMPRODUCT(--(TEXT(D3:D25,"MMM")=O5),--(M3:M25<>0))
If using this type of formula (barring the last argument is not screwed up - which will give you the #DIV/0 error) on error you will natively get the #N/A error (usually, not always), so no need to trap for it like you were in the IF statement. Depending on the circumstances, you may tend to get one error or the other.
Transversley you can use this array formula also ...
=AVERAGE(IF((TEXT(D3:D25,"MMM")=O5)*(M3:M25<>0),M3:M25))
Which should work just as fast (you won't notice the difference), but a little shorter. It must be confirmed with Ctrl + Shift + Enter instead of just Enter.