Microsoft Office Online
Sign in to My Office Online (What's this?) | Sign in

 
 
Microsoft Office Excel
Search
Search
 
Check for updates: (c) Microsoft
Office downloads
 
 
 
Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.

Email this linkEmail this link Printer-Friendly VersionPrinter-Friendly Version Bookmark and ShareShare
Correct a #DIV/0! error
 

Excel displays the #DIV/0! error when a number is divided either by zero (0) or by a cell that contains no value.

Symptom

Excel displays the #DIV/0! error in one or more cells on a worksheet.

Causes

  • Entering a formula that performs explicit division by zero (0) — for example, =5/0.
  • Using a reference to a blank cell or to a cell that contains zero as the divisor in a formula or function that performs division.
  • Running a macro that uses a function or a formula that returns the #DIV/0! error.

Example

When you copy the example data to a blank worksheet, the formulas in cells A3, A4, and A5 all return a #DIV/0! error.

ShowHow do I copy an example?

  1. Select the example in this article.

     Important   Do not select the row or column headers.

    Selecting an example from Help

    Selecting an example from Help

  2. Press CTRL+C.
  3. In Excel, create a blank workbook or worksheet.
  4. In the worksheet, select cell A1, and press CTRL+V.

     Important   For the example to work properly, you must paste it into cell A1 of the worksheet.

  5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Formulas tab, in the Formula Auditing group, click the Show Formulas button.

After you copy the example to a blank worksheet, you can adapt it to suit your needs.


 
1
2
3
4
5
A
1
0
=A1/0
=A1/A2
=QUOTIENT(A1,A2)

Resolution

  • Make sure that the divisor in the function or formula is not zero (0) or blank.
  • Change the cell reference in the formula to another cell that does not contain a zero or a blank value.
  • Enter the value #N/A in the cell that is referenced as the divisor in the formula.

    Entering #N/A will change the result of the formula to #N/A from #DIV/0! to indicate that the divisor value is not available.

  • Prevent the error value from being displayed by using the IF worksheet function. You can then display 0 or any string as the result.

    For example, if the formula that produces the error is =A1/A2, use =IF(A2=0,"",A1/A2) to return an empty string, or =IF(A2=0,0,A1/A2) to return 0.

Related Office Online discussions

Read related questions and answers from other Microsoft Office customers.

advertisement