Mastodon Mastodon
Excel Errors

How to Fix #DIV/0! Excel Error?

#DIV/0! Shows Errors When Something Goes Wrong With A Formula!

What is Excel #DIV/0! Error
What is Excel #DIV/0! Error

The #DIV/0! error is one of the most common errors in Excel. It appears when there’s a problem in a formula, usually when a number is divided by zero or an empty cell. In this article, you’ll learn what the error means, why it shows up, what causes it, how to fix it, and how to prevent it from happening again.

What Does this Error Mean?

#DIV/0! error in Excel means “Divide by Zero” and This error appears when a number is divided by zero or by an empty cell. Generally in maths, any number dividing by zero(0) is not possible and Excel follows the same rule. So, if you try to perform a division in Excel where the denominator is zero or blank, it will show #DIV/0! instead of a number.

Error NameIntroduced Excel Version
#DIV/0!Excel 2000

Realtime Example:

You can understand how this error works by looking at the real-time example below.

ItemTotal SalesNo of customersAverage Sales per CustomerFormula Used
Pencil250000#DIV/0!=C5/D5
Real-time Example of #DIV/0! error
Real-time Example of #DIV/0! error

Here, the formula in cell E5 is =C5/D5. You are trying to divide 25000 by 0. As per math rules, this is not valid. So Excel will return, #DIV/0! Error. Now, if you change the number of customers in cell D5 to 10, the formula will work, and D2 will show 2500.

How to Prevent or Fix this #DIV/0! Error?

You can follow the below list before executing function or formula to prevent or permanently fix the error.

  • You must need to make sure the cell value does not contain zero(0) or is a empty cell.
  • Check the input values before executing a formula or function.
  • You can use the IF function or IFERROR function to validate the input values.
    • For Example, =IFERROR(your formula;0)
    • Here in the scenario, =IFERROR(C5/D5,"Cell value contains Zero") and it will display the output “Cell value contains Zero“.
Using IFERROR Function to Prevent this #DIV/0! error.
Using IFERROR Function to Prevent this #DIV/0! error.

Common Function/Formula Causing #DIV/0! Error:

Here are the some common formula and function causing #DIV/0! error while executing it.

Basic Division by Zero or Blank Cell:

  • Formula used here is,
    • =C5/D5, If the value D5 is empty or zero(0) and the formula returns #DIV/0! error.
Formula returns the #DIV/0! Error, when divided by zero or blank cell.
Formula returns the #DIV/0! Error, when divided by zero or blank cell.
  • You can fix the error by using IF function along with the formula.
    • The updated formula is =IF(D5=0, "Cannot divide by 0", C5/D5) and it returns the value “Cannot divide by 0“.

While Using AVERAGE Function:

This error commonly occurs when using the AVERAGE function in Excel. The AVERAGE function needs valid numerical values to calculate the result. If the selected range contains empty cells or only zero values, it will return a #DIV/0! error, indicating there is nothing to average.

AVERAGE Function returns #DIV/0! Error
AVERAGE Function returns #DIV/0! Error
  • Formula used here,
    • =AVERAGE(C5:D7)

In the example above, the AVERAGE function shows an error when it tries to calculate the average of empty cells.

  • You can fix this error by IFERROR function in the formula and the updated formula is,
    • =IFERROR(AVERAGE(C5:D7), "No valid numbers") and it returns the value as “No valid numbers“.

While Using QUOTIENT Function:

#DIV/0! Error Occurs while using QUOTIENT Function
#DIV/0! Error Occurs while using QUOTIENT Function

As shown in the example above, the #DIV/0! error appears when using the QUOTIENT function. This happens because the QUOTIENT function is designed to return the quotient when one number is divided by another. In this case, since the number is being divided by 0, the function returns an error, as division by zero is not allowed in Excel. To fix this, you can use the below formula to overcome the error.

=IF(B1=0, "Invalid", QUOTIENT(B5,C5) //returns Invalid...

Important Notes:

  • This error is fixable and reversible, you must need to check the input values.
  • Excel formulas continue to work even if some cells have this error.
  • Excel also shows a small green triangle in the top-left of the cell to indicate an error is present.
Small green triangle in the top-left of the cell appears when error occured.
Small green triangle in the top-left of the cell appears when error occured.

That’s it.

Narendhiran Vijayakumar.

Reference Sources:

Narendhiran Vijayakumar

Hello~ I'm Narendhiran Vijayakumar, a dedicated web developer with strong skills in both frontend frameworks and backend development with PHP. I enjoy creating websites that are user-friendly & user-interactive. I've successfully created and launched several platforms, including Klickaud.org, Forhub.io, and IMGCentury.com.
Back to top button