Correct a #DIV/0! error
This error occurs when a number is divided by zero (0).
- Optionally, click the cell that displays the error, click the button that appears
, and then click Show Calculation Stepsif it appears. - Review the following possible causes and solutions.
Entering a formula that contains explicit division by zero (0) - for example, =5/0
Change the divisor to a number other than zero.
Using the cell reference to a blank cell or to a cell that contains zero as a divisor
Note If the operand is a cell that is blank, Microsoft Office Excel interprets the blank as zero.
- Change the cell reference to another cell.
- Enter a value other than zero in the cell used as a divisor.
- Enter the value
#N/Ainto the cell referenced as the divisor, which changes the result of the formula to #N/A from #DIV/0! to denote that the divisor value is not available. - Prevent the error value from displaying by using the IF worksheet function. For example, if the formula that creates the error is =A5/B5, use =IF(B5=0,"",A5/B5) instead. The two quotation marks represent an empty text string.
Running a macro that uses a function or a formula that returns #DIV/0!
Make sure that the divisor in the function or formula is not zero or blank.