The DIV/0 error in Excel appears when a formula tries to divide a number by zero, or by a cell that is empty or contains text instead of a number. The quickest fix is to wrap the division in the IFERROR function: =IFERROR(A2/B2,"") returns a blank cell (or any message you choose) instead of the error. That single change handles all three causes at once, and you can copy it down a whole column in seconds.

DIV/0 is one of Excel's most common error values, and it is almost never caused by a mistake in the arithmetic itself. It is a data problem: an average of a range where every cell is blank, a percentage calculation where the denominator is currently zero, or a lookup that returns nothing to divide by. Because the error disappears as soon as the source data is filled in, the real goal is usually to keep the error from spreading into SUM totals, charts, dashboards and conditional formatting while the data is incomplete. The steps below cover the quick fix, the more precise IF-based version, and how to find every cell that is producing the error.

What You'll Need

  • Excel for Microsoft 365, Excel 2021/2019/2016, or Excel for Mac — IFERROR and IF are available in all of them.
  • Excel for the web (the browser version) also supports these functions.
  • Edit access to the workbook. If it is shared or read-only, save a copy first.
  • A few minutes; no add-ins or macros are required.

A note before starting: menu and ribbon labels can differ slightly between versions, platforms and regions, and the function separator differs too. Windows and the web version normally use a comma between arguments (IFERROR(A2/B2,"")), while some regional settings and Mac installations use a semicolon (IFERROR(A2/B2;"")). If Excel rejects your formula with a "There's a problem with this formula" message, the separator is the first thing to check.

Step-by-Step

  1. Confirm it really is DIV/0. Click the cell and read the formula bar. The status bar at the bottom left also shows the error when the cell is selected. If the cell shows #DIV/0!, the formula contains a division by zero, an empty cell, or text where a number is expected.
  2. Find the denominator. Look at the cell reference after the slash in the formula. For =A2/B2, the denominator is B2. Click that cell and check whether it is empty, contains 0, or holds text such as a dash or a space. This is the root cause in most workbooks.
  3. Decide the intended behaviour. Choose whether a blank cell or a readable label suits your sheet better. A blank ("") keeps totals and charts clean. A label such as "No data" or "N/A" tells the reader why nothing is shown. Note that a text label will break SUM over that column, while a blank is ignored.
  4. Apply the quick fix. Select the cell holding the formula, press F2 (or click the formula bar), and wrap the existing formula in IFERROR. Type =IFERROR( in front of the original expression and ,"") after it. For example, =A2/B2 becomes =IFERROR(A2/B2,""). Press Enter.
  5. Copy it down the column. With the corrected cell selected, double-click the small fill handle square at the bottom-right corner of the selection border, or drag it down. Excel adjusts the relative references automatically. If you are on a Mac without a mouse, use Edit > Fill > Down after selecting the range.
  6. Use the more precise IF version if you want to control only the zero case. IFERROR hides every error type in that cell, including genuine problems such as #REF! or #VALUE!. If you would rather see those, use =IF(B2=0,"",A2/B2) instead. This returns blank only when the denominator is zero and lets real errors surface.
  7. Fix blanks rather than hiding them where it matters. For averages, replace =AVERAGE(B2:B10) with =IFERROR(AVERAGE(B2:B10),"") only if a blank result is acceptable. If the range should always have data, the better fix is to find and fill the missing values so the average is genuinely correct.
  8. Hunt down every remaining error. Select the whole used range, then use Home > Find & Select > Go To Special > Formulas > Errors (the exact wording is Home > Editing > Find & Select in most versions). Excel selects only the error cells, so you can check each formula and apply the same fix. Alternatively, use conditional formatting with a formula rule to highlight errors in colour as you work.
  9. Check for errors hidden by Paste Special. If you copied formulas and pasted them as values, the resulting #DIV/0! text is no longer a formula and IFERROR in another cell will not remove it. Find them with Find & Replace, searching for #DIV/0!, and correct the source data or delete the pasted cells.
  10. Protect the fix in shared workbooks. If other people enter data, keep the denominator column formatted as numbers (not text) and consider data validation on that column to prevent text entries. This stops the error from being recreated the moment someone types a dash into a volume column.

Common Mistakes

Using IFERROR on the entire calculation instead of the denominator. =IFERROR(A2)/B2 is invalid syntax and will not do what you want. The whole division must sit inside IFERROR's first argument.

Swallowing real errors. Wrapping everything in IFERROR can hide broken references and text-in-number problems that you actually need to see. In audit, finance or reporting sheets, the IF version that checks only for zero is safer.

Returning a text label and then summing. If IFERROR returns "N/A", SUM skips it, but AVERAGE does not, and charts may treat the column inconsistently. Blank strings are usually the better default for numeric columns.

Keeping the denominator as text. A number stored as text (often left-aligned in the cell, with a green warning triangle) can trigger DIV/0 in formulas that reference it. Convert with Text to Columns or multiply by 1 in a helper cell.

Forgetting the separator. Pasting a formula from a web page that uses commas into a locale that expects semicolons fails with a formula error rather than a DIV/0 fix.

Tips

Use IFERROR sparingly and deliberately — one wrapped division is fine, but wrapping every formula in a sheet makes problems invisible. Name the denominator cells or use a structured table reference so it is obvious which column drives the division. For dashboards, a helper column that returns blanks while data is missing keeps the visible report clean without altering the underlying numbers. When you need to know how many cells failed rather than hide them, =COUNTIF(range,"#DIV/0!") gives a quick count, and a separate check cell can flag the sheet for review.

Troubleshooting

The formula still shows #DIV/0! after wrapping. Check that the closing parenthesis is present and that both arguments are separated correctly. A missing bracket often produces a different error, but a mis-placed one can leave the division outside IFERROR.

Excel rejects the formula entirely. Change commas to semicolons, or the reverse, to match your regional settings. The formula bar shows the separator your version expects.

The error returns when new data is entered. Someone is typing text or zero into the denominator column. Apply data validation to restrict the column to numbers, and check whether the zero is a deliberate placeholder that should be blank instead.

The error is in a chart or pivot table, not a cell. Charts inherit cell errors, so fixing the source cells clears the chart. In a pivot table, right-click the value field and check the field settings; if a calculated field divides by a count that can be zero, an IF wrapper in the calculated field formula is needed.

The cell shows the error but the formula looks fine. Press Ctrl+` (the key left of 1) to toggle formula view on Windows, or use Formulas > Show Formulas, to inspect what is actually in the cell rather than what the formatting displays. Remember to toggle it back.

Frequently Asked Questions

Why does Excel show #DIV/0! when my denominator cell looks blank?

Because blank cells count as zero in a division. The formula cannot divide by nothing, so Excel reports DIV/0. Filling the cell or wrapping the formula in IFERROR resolves it.

What is the difference between IFERROR and IF here?

IFERROR catches every error in the cell, while =IF(B2=0,"",A2/B2) catches only the zero denominator and lets other errors show. Use IF when you need to notice broken references.

Does IFERROR work in Excel for the web and on Mac?

Yes, IFERROR is supported in Excel for the web, Excel for Mac and all recent desktop versions. Only the argument separator may differ.

Can I remove all DIV/0 errors in a sheet at once?

Not with a single built-in command. Go To Special > Formulas > Errors selects them all so you can correct each formula, or use Find & Replace to locate the text if formulas were pasted as values.

Would deleting the zero cells fix it?

Making the denominator blank stops the error, but the result is then blank or zero, which may distort averages. Only do this if the zero is genuinely a missing value rather than a real measurement.