Two ideas:
(1) A formula with SUMPRODUCT (my preference in this case)
=SUM(A1:A5)/(SUMPRODUCT((A1:A5<>0)+0))
(2) The famous array formula:
=AVERAGE(IF(A1:A10,A1:A10))
You need to hit CONTROL+SHIFT+ENTER at the same time (not just ENTER) to enter an array formula.
Both will ignore 0's and blanks.
Aladin
Thanks again for your help, of course I realized as soon as I posted the question that the Average function already ignored blanks in a range, what I really needed was to ignore zeroes. Of course both of the formulas that you suggested worked. I used the first one. May I ask why that was your preference?
It does not require a special method of entering and care, which is of course a minor point. Although I don't have any evidence yet, it may perform better (i.e., may require less time) on larger ranges of cells.
Aladin