Omit Zeros from the Average Function/Formula
Excel Average Without Zeros
See Also MIN Excluding Zeros
Excel has a built in formula/function that makes averaging a range of cells easy. If we assume your numbers are in A1:A100 you would simply use the Average formula like shown below;
There is however, one draw-back with this. That is, it includes cells that contain 0 (zeros). This can give you unexpected results. While the sum of values is not effected, the count of them is. Average is the sum of numbers divided by the count of numbers. So how do we omit zeros from our average?
SUMPRODUCT & SUM
This method is the most generic in that it ignores blank cells and will include negative numbers.
COUNTIF & SUM
This method will not work should you have negative numbers unless you change ">0" to "<>0" The drawback is it will then count blank cells. Where as the one below wont.
=SUM(A1:A100) / (COUNT(A1:A100) - COUNTIF(A1:A100,0))
=SUMIF(A1:A100,">0")/COUNTIF(A1:A100,">0") Will also exclude negatives unless you use "<>0". However, it will then count blank cells.
If you do have negative numbers, and no blank cells, use;
The other method is via the DAVERAGE function. This function is part of the Database functions and all are extremely useful when/if you need specify multiple criteria. The DAVERAGE , in the case of numbers being in A2:A100 (A1 should be a heading) we could use the DAVERAGE like below;
Where "1" represents the relative column position to average in the range A1:A100
B1 has an exact copy of your heading in A1
B2 houses the expression >0
This method is the least efficient. By creating an array formula we can use the Average formula as shown below to omit zeros;
As these are array formulas they MUST be entered via Ctrl+Shift+Enter.