ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I get rid of the #DIV/O in a cell? (https://www.excelbanter.com/excel-worksheet-functions/36269-how-do-i-get-rid-div-o-cell.html)

KMHarpe

How do I get rid of the #DIV/O in a cell?
 
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!

aristotle

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

--
Please rate my response if you found it helpful. Thanks.


"KMHarpe" wrote:

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!



All times are GMT +1. The time now is 02:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com