*sort by* **best** latest

### Ding Lara says

"#DIV/0!" is the result of a formula when divisor cell contains nothing. I use an "if" formula that returns nothing if the divisor cell is blank or has 0 in it. Test this by typing numbers 1 to 3 in cells a1 to a3 and numbers 1 to 2 in cells b1 to b2. In cell c1, type the formula: =if(b1=0,0,a1/b1) and copy this formula to cells c2 and c3. Cell c3 will display 0 and not #DIV/0! although cell b3 has nothing in it.

### dabeaner says

Number -- that is not an error. Excel (or any program doing arithmetic) will display a similar "divide by zero" message. It is better for the program to stop or go to an error routine than to try to continue with "infinity" (impossible) or the largest number available to the program.

### A. E. Beck says

First, the technical answer (if it's boring or you don't understand, just skip to the practical part):

Actually, there may be some confusion involved here. Under the standard interpretation of the mathematical operator "/", the operator is "undefined" for 0. What this means is that the operator denotes a "partial" function which is not defined for every input.

There could be systems in which division by 0 results in "infinity," but this would be a non-standard system. (Although in the most popular non-standard system, based on infinitesimals and transfinite cardinals, division by zero is still undefined.)

Wikipedia has a nice article that goes through some possibilities, including the idea that division by zero results in infinity.

http://en.wikipedia.org/wiki/Division_by_zero

Practical answer:

"#DIV/0!" is not strictly a bug, it was intentional. This is Excel's way of saying "undefined," but there may be a way to get a different result. One solution might be to write a macro which scans the Excel worksheet either for "#DIV/0!" or for formulae which actually divide by zero, and then overwrites these entries with something more meaningful (for example "infinity"). There may be other ways, but that is the one that comes to mind.