Average excluding zeros

Seb -  
Gyrus Posted messages 3360 Status Membre -
Hello,

I want to calculate an average of certain numbers without considering the 0s, but if there are only 0s, I want my average to be 0.

I have a formula =AVERAGEIFS(range1;criteria1;criteria_range0;"<>0")
Everything works perfectly so far regarding the exclusion of 0s in my average.

However, if I only have 0s in this range, the result is $DIV/0!

I would like that if there are only 0s in my range, the average is 0.

Need help!

17 réponses

Mike-31 Posted messages 18405 Registration date   Status Contributeur Last intervention   5 145
 
Hello thread,

I don't see where the problem is that has already been explained by the speakers whom I greet

example for the range A2:A20
=IF(SUM(A2:A20)=0,0,AVERAGEIFS(A2:A20,A2:A20,">0"))

--
Best regards
Mike-31

A period of failure is a perfect time to sow the seeds of knowledge.
1