divide by zero error

  • Thread starter Thread starter Graham Bennet
  • Start date Start date
G

Graham Bennet

Hello All,

Does anyone know how to stop the divide by zero error appearing in a cell.

Thanks, Graham
 
By testing the denominator as in:

=IF(B1,A1/B1,0)

=IF(N(B1),A1/B1,"")
 
If A1=0, A2=20 for example,
=A2/A1 will give #DIV/0
=IF(A1<>0,A2/A1,0)
will give Zero if A1 is Zero, if not the result of the calculation, or
=IF(A1<>0,A2/A1,"Your Error Message")
will generate any message you want,
in other words, use the IF function to establish if the divisor is Zero or
not, if it is, Error message of your choice, if not, perform the
calculation,
Regards,
 

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

Similar Threads


Back
Top