How do I get rid of the #DIV/O in a cell?

G

Guest

I put in the formula:

(SUM(A1:A6)/(COUNT(A1:A6)-COUNTIF(A1:A6,0)))

Some of the worksheets that I put this formula are going to have zero's at
times, so how do I change the formula to not have anything in the cell at all
instead of #DIV/0?

Thanks for your help!
 
G

Guest

Hi,

=IF(ISERROR((SUM(A1:A6)/(COUNT(A1:A6)-COUNTIF(A1:A6,0)))),0,(SUM(A1:A6)/(COUNT(A1:A6)-COUNTIF(A1:A6,0))))

Basically says that if formula returns an error then value = 0 else redo the
formula.

Cheers,
A
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top