dividing by 0

  • Thread starter Thread starter djackson
  • Start date Start date
D

djackson

ok say I have 2 cells we will call them c2, d2. I am wanting to divid
d2/c2 where d2 equals 7, c2 equals 0. What would be a small formula t
assist with this? I simply tried =IF(c2=0,0,d2/c2)

Any help appreciated
 
What do want to see in the cell with the formula?

The way it is written, if C2 = 0, show 0 otherwise show the result of D2/C2

You cannot realistically divide any number by 0 so what you have written is
correct in my view.

Gord Dibben Excel MVP
 
Gord Dibben wrote...
What do want to see in the cell with the formula?

The way it is written, if C2 = 0, show 0 otherwise show the result of D2/C2

You cannot realistically divide any number by 0 so what you have written [=IF(c2=0,0,d2/c2)] is
correct in my view.

Just to add to Gord's comments....

Sometimes you have a more complicated denominator, and you want to ensure
that you are not dividing by 0. And if the denominator is 0, you prefer to
have the answer display 0 rather than #DIV/0!. To solve this issue, you can
write your formula in this manner.

=IF(ISERROR(YourFormula), 0, YourFormula)

So if YourFormula triggers #DIV/0!, a zero will be displayed. You have to
be careful with this solution though because "ISERROR" is a large bucket
that traps any error value. Sometimes it is helpful seeing the error so you
can take corrective measures.

Hope this helps.

Best regards,
Kevin
 
Back
Top