How To Fix The #DIV/0! Error In Excel (2026)

Excel shows #DIV/0! when a formula divides a number by zero.

The same thing happens when the divisor is a blank cell, which is why a formula that worked yesterday can break when someone clears a cell.

This guide uses Microsoft’s own fixes, from correcting the divisor to hiding the error while you wait for input.

Table of Contents

Quick answer: fix the divisor or test it first

Check the number you are dividing by, because it is zero or empty.

SituationFix
The divisor should have a valueEnter the value, or point the formula at a different cell
The divisor is not known yetWrap the formula in IF or IFERROR
You want to flag missing dataEnter #N/A in the divisor cell

What causes #DIV/0!

Microsoft names two causes.

  • You enter a formula such as =5/0.
  • A formula refers to a cell that contains 0 or is blank.

In a formula like =A2/A3, the cell after the slash is the divisor, so look at A3 first.

Fix the divisor directly

When the error is a real mistake, change the data or the reference.

  1. Click the cell showing #DIV/0! and read the formula in the formula bar.
  2. Find the divisor, which is the cell after the division sign.
  3. Make sure that cell is not zero or blank.
  4. If it should hold a number, type it in.
  5. If the reference is wrong, point the formula to a different cell that does not contain 0 or a blank.

Show #N/A when the divisor is missing

Another option on Microsoft’s page is to enter #N/A in the divisor cell.

The formula result then changes to #N/A, which tells readers that the divisor value is not available instead of implying a calculation failed.

Use IF to test the divisor first

If the divisor will be filled in later, test it before dividing.

The formula =A2/A3 becomes =IF(A3,A2/A3,0), which divides only if A3 has a value and otherwise returns the alternative you choose.

FormulaResult when A3 is 0 or blank
=IF(A3,A2/A3,0)0
=IF(A3,A2/A3,"")An empty string
=IF(A3,A2/A3,"Input Needed")The message Input Needed
=IF(A3,QUOTIENT(A2,A3),0)0, using QUOTIENT instead of the division sign

The logic is that if A3 has a value the formula returns the division result, and otherwise it returns the alternative.

Use IFERROR to catch the error

IFERROR returns a value you specify if the formula evaluates to an error, and the normal result otherwise.

The syntax is IFERROR(value, value_if_error), so =IFERROR(A2/A3,0) returns 0 when the division fails.

Microsoft’s own example divides 55 by 0 and returns the text Error in calculation, while 210 divided by 35 returns 6.

FormulaResult
=IFERROR(210/35,"Error in calculation")6
=IFERROR(55/0,"Error in calculation")Error in calculation
=IFERROR(A2/A3,0) with A3 blank0

If either argument is an empty cell, IFERROR treats it as an empty string.

The caution about hiding errors

Both IFERROR and IF with ISERROR suppress every error, not only #DIV/0!.

A typo that causes #NAME? or a deleted cell that causes #REF! would be hidden too.

Microsoft’s advice is to confirm that the formula works correctly before you add error handling, or you may miss a real problem.

The IF(A3,…) form is safer for division because it reacts only to a zero or blank divisor.

Hide a zero or the error markers

If the 0 returned by IFERROR looks odd, Microsoft shows a way to hide it without removing the value.

  1. Select the cells and go to Home > Conditional Formatting > New Rule.
  2. Create a rule for a cell value equal to 0.
  3. Set a custom number format of three semicolons, ;;;.

The cell then shows nothing, but the value 0 remains.

To remove the green triangles instead, go to File > Options > Formulas and clear Enable background error checking.

Step through the error

If error checking is turned on, a button appears next to the cell showing the error.

  1. Select the button next to the cell.
  2. Select Show Calculation Steps, if it is available.
  3. Choose the resolution that fits your data.

On Windows you can also use Formulas > Formula Auditing > Evaluate Formula to see each part of a nested formula calculate.

Replace errors in a PivotTable

A PivotTable has its own setting for error values.

  1. Select the PivotTable.
  2. On the PivotTable Analyze tab, click the arrow next to Options, then click Options.
  3. On the Layout & Format tab, select For error values show and type the text to display.

Leave the box empty to show blank cells.

Which method to choose

Pick the method by what you want the sheet to show while the divisor is missing.

MethodBest whenWatch out for
Fix the divisorThe zero or blank is a mistakeNothing to hide, the formula just works
IF on the divisorYou want a blank, 0 or message until input arrivesOnly reacts to a zero or blank divisor
IFERRORYou want any error replacedAlso hides unrelated errors
#N/A in the divisorYou want to flag the value as unavailableResult shows #N/A instead of #DIV/0!

The short guard formula from Microsoft

Microsoft’s broken-formulas page gives the same guard in its shortest form, =IF(B1,A1/B1,0).

If B1 has a value, the formula divides A1 by B1, and otherwise it returns 0.

Copy that pattern down a column and every row protects itself.

How #DIV/0! differs from other errors

ErrorWhat it means
#DIV/0!A number is divided by zero or by an empty cell
#NAME?Excel does not recognize text in the formula
#N/AA value is not available to a function
#REF!A cell reference is no longer valid
#VALUE!The formula mixes incompatible data types

Turn error checking on or off

The green triangle and the button beside the cell only appear when background error checking is on.

On Windows go to File > Options > Formulas, and on Mac go to the Excel menu > Preferences > Error Checking.

To walk through every flagged cell one by one, use Formulas > Formula Auditing > Error Checking.

For the other common error values, see how to fix #N/A, #VALUE! and #REF! errors in Excel.

If a misspelled function is behind your error, read how to fix the #NAME? error in Excel.

If the formula shows as text instead, try Excel formulas not calculating.

Official sources

The fixes come from Microsoft’s How to correct a #DIV/0! error, with details from IFERROR function and Hide error values and error indicators in cells.

Leave a Reply

Your email address will not be published. Required fields are marked *