AVERAGEIF(range, criteria) formula that ignores errors in the data
Providing you are using Excel 2010 and above the AGGREGATE function can be optioned to ignore all errors.
=AGGREGATE(1, 6, A1:A5)
This will work as long as there aren't any negative numbers in your data:
=AVERAGEIF(A1:A5,">=0")