The returns log includes West 12, East 20, West 6, and West with an unknown duration. Put location in column A and hours in B.

Average the measured values from West

Use =AVERAGEIF(A2:A5,"West",B2:B5). The West rows with measurements give (12 + 6) ÷ 2 = 9 hours. Label the result “West mean hours per measured return” and give the count of measured rows.

The West measurements are 12 and 6 hours, with a third West row left blank.

Illustrated selection. The East row is outside the calculation.

Make a real zero change the result

In a copy enter 0 in B5. The numerator is still 18, but the denominator becomes 3, so the mean is 6. Restore the blank if the duration was unknown. If no qualifying measurements remain, review the inputs before publishing a mean.

Entering zero changes the denominator to three and the West mean to 6.

Illustrated denominator test.

Related Microsoft Excel reference