ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Errors & fixes
  3. #DIV/0! Error in Excel and How to Avoid It

#DIV/0! Error in Excel and How to Avoid It

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

#DIV/0! means a formula tried to divide by zero or by an empty cell. Fix it by checking the divisor first: =IF(B2=0,"",A2/B2) shows a blank until B2 has a number. =IFERROR(A2/B2,"") is shorter but hides every other error too. AVERAGE and AVERAGEIF also return #DIV/0! when there are no numbers to average.

Key takeaways

  • #DIV/0! means the divisor is 0, blank, or a range with no numbers to average.
  • =IF(B2=0,"",A2/B2) checks the divisor first and is the most precise fix.
  • =IFERROR(A2/B2,"") is shorter, but it also hides #VALUE!, #REF! and #NAME? errors.
  • Showing 0 instead of the error can pull averages down; a blank or a label is often clearer.
  • Percent change from a starting value of 0 has no meaningful answer; label it, for example as New.
On this page+
  1. What does #DIV/0! mean in Excel?
  2. Fix 1: check the divisor with IF
  3. Fix 2: catch the error with IFERROR
  4. Percent change when the old value is 0
  5. AVERAGE, AVERAGEIF and #DIV/0!
  6. Should you show 0, a blank or a label?
  7. Find and fix every #DIV/0! in a report
  8. Other errors that look similar
  9. Practise it

The #DIV/0! error in Excel appears when a formula divides by zero, or by a cell that is empty. It's the most predictable error in Excel: it shows up in averages per order, conversion rates and percent change whenever the bottom number is missing. This guide shows the causes, the two standard fixes, and how to choose what the cell should show instead.

What does #DIV/0! mean in Excel?#

#DIV/0! means "divided by zero". Dividing by zero has no answer in math, so Excel shows an error instead of a number.

Excel treats an empty cell as 0 in a division, so these all return #DIV/0!:

FormulaA2B2Result
=A2/B25000#DIV/0!
=A2/B2500(empty)#DIV/0!
=A2/0500#DIV/0!
=A2/B25002025

If B2 holds text such as "n/a" instead, the result is #VALUE!, a different error covered in our #VALUE! guide.

Fix 1: check the divisor with IF#

The most precise fix tests the bottom number before dividing. Use IF:

Excel formula
=IF(B2=0,"",A2/B2)
  • B2=0 is the test. It's TRUE when B2 is 0 or empty.
  • "" is what to show when the test is TRUE: empty text, so the cell looks blank.
  • A2/B2 is the normal calculation, used only when B2 isn't 0.

Fill it down and every row with a missing divisor shows a blank, while every other row shows its normal result. You can show anything in the second argument: 0, "n/a" or "No sales".

Fix 2: catch the error with IFERROR#

IFERROR is shorter: it returns the normal result unless the formula produces an error.

Excel formula
=IFERROR(A2/B2,"")

This works well, and it's what many people use. The catch is that IFERROR catches every error. If A2 contains a typo that causes #VALUE!, or the formula has a misspelled name that causes #NAME?, IFERROR hides that too, and you see a tidy blank instead of a warning.

IF(B2=0, …)IFERROR(…)
Handles divide by zeroYesYes
Also hides #VALUE!, #REF!, #NAME?NoYes
LengthLongerShorter
Best forRatios where only the divisor can be missingQuick reports where any error should be blank

Use IF when you want other mistakes to stay visible. Our guide on using IFERROR the right way covers more patterns.

Percent change when the old value is 0#

Percent change is (new - old) / old, so it fails when the old value is 0. That's not just a technical error: growth from nothing has no meaningful percentage.

ABCD
1ProductLast YearThis YearGrowth
2Smart Plug01,200#DIV/0!
3Desk Fan2,5002,75010%

Label those rows instead of forcing a number:

Excel formula
=IF(B2=0,"New",(C2-B2)/B2)

Row 2 shows New and row 3 shows 10% (0.1 formatted as a percentage). Sales and operations reports use this pattern all the time; see Excel skills for sales and operations roles and our percent change formula guide for the full method.

AVERAGE, AVERAGEIF and #DIV/0!#

AVERAGE divides a total by a count. When there are no numbers to count, it divides by zero.

  • =AVERAGE(D2:D10) returns #DIV/0! if D2:D10 is empty or contains only text.
  • =AVERAGEIF(B2:B20,"West",C2:C20) returns #DIV/0! if no row says West.
  • =AVERAGEIFS(…) does the same when no row meets every condition.

Fix them the same way. Either count first:

Excel formula
=IF(COUNTIF(B2:B20,"West")=0,"No orders",AVERAGEIF(B2:B20,"West",C2:C20))

or wrap the average in IFERROR: =IFERROR(AVERAGEIF(B2:B20,"West",C2:C20),"No orders").

Should you show 0, a blank or a label?#

Choose based on what happens to the cell next. The replacement isn't just cosmetic: other formulas and charts read it.

  • A blank ("") is the safest default. AVERAGE, SUM and MAX ignore text, so blanks don't distort them. But a formula that does math directly on the cell, like =D2*2, returns #VALUE! on "".
  • 0 looks like a real result. If the average price of a product with no sales shows 0, an average of that column is pulled down.
  • A label like "New" or "No data" is clearest for people reading the report. Like a blank, it's text, so math on it fails.

When in doubt, use a blank in calculation columns and a label in summary tables people read.

Find and fix every #DIV/0! in a report#

In a long report, fix the errors in one pass instead of cell by cell.

  1. Find them. Press Ctrl+F (⌘F on a Mac), type #DIV/0!, click Options, set Look in to Values and click Find All. The list shows every cell that currently displays the error.
  2. Decide if it's expected. A row for a product with no sales yet is expected. A divisor that should never be 0, like the number of working days in a month, points to missing or wrong data, so fix the data instead.
  3. Fix the first formula, then fill. Edit the top cell of the column, for example to =IF(B2=0,"",A2/B2). Then select it and the cells below and press Ctrl+D (⌘D on a Mac) so every row uses the same rule.

A common example is a conversion rate in a weekly report: orders divided by visits. With visits in column B and orders in column C, weeks with no visits yet show #DIV/0! until the data arrives. =IF(B2=0,"",C2/B2) keeps those rows clean without hiding real problems in the others.

Other errors that look similar#

#DIV/0! is about the divisor. If the math itself is impossible for another reason, such as the square root of a negative number, you get the #NUM! error instead. If Excel doesn't recognise a function name in your formula, you get the #NAME? error.

Practise it#

Fix the growth formula in the exercise on this page. Then practise IFERROR in a live spreadsheet, where two products sold nothing, and work through the percentages and % change lesson to build growth formulas step by step.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

The growth formula =(C2-B2)/B2 shows #DIV/0! for the Smart Plug, because it sold nothing last year (B2 is 0). In D2, use IF so the cell shows New when B2 is 0, and the % change otherwise.

fx
ABCDE
1
Product
Last Year
This Year
Growth
2
Smart Plug
0
1200
3
Desk Fan
2500
2750
4
Kettle
3100
2790
5
Lamp
1800
2160
6
7
8

Tip: IF(test, value if true, value if false): test B2=0, show "New" if true, otherwise calculate (C2-B2)/B2.

Practise this in a lesson

LessonIFERRORReplace ugly errors like #DIV/0! with a clean fallback value using IFERROR, and learn when hiding errors backfires.LessonPercentages and % changeCalculate percent change with (new - old) / old, format it as a percentage, and grow a number by a percent.Function guideIFERRORUse IFERROR to swap #N/A, #DIV/0! and other errors for a clean value. Examples with division and VLOOKUP, pitfalls, and live practice.Function guideIFLearn Excel's IF function with practical examples: flag budgets, label rows and return blanks. Avoid the classic mistakes and practice live.

Frequently asked questions

What does #DIV/0! mean in Excel?

+

It means a formula tried to divide by zero. Excel treats an empty cell as zero in division, so dividing by a blank cell gives the same error.

How do I get rid of #DIV/0! in Excel?

+

Wrap the division in IF to check the divisor first, like =IF(B2=0,"",A2/B2), or in IFERROR, like =IFERROR(A2/B2,""). Both show a blank instead of the error.

Should I show 0 or a blank instead of #DIV/0!?

+

A blank is usually safer. A 0 looks like a real result and is included in averages and charts, while AVERAGE skips empty-looking text results.

Why does AVERAGE return #DIV/0!?

+

AVERAGE divides the total by the count of numbers. If the range has no numbers at all, the count is 0, so the division fails.

Is IF or IFERROR better for #DIV/0!?

+

IF is more precise because it only handles a zero divisor. IFERROR is quicker to write, but it also hides other mistakes, such as a typo that causes #NAME?.

Sources

  • IFERROR function - Microsoft Support
  • IF function - Microsoft Support
  • AVERAGEIF function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What does #DIV/0! mean in Excel?
  2. Fix 1: check the divisor with IF
  3. Fix 2: catch the error with IFERROR
  4. Percent change when the old value is 0
  5. AVERAGE, AVERAGEIF and #DIV/0!
  6. Should you show 0, a blank or a label?
  7. Find and fix every #DIV/0! in a report
  8. Other errors that look similar
  9. Practise it

Keep reading

Errors & fixes· 5 min read

#NAME? Error in Excel: Typos, Quotes and Missing Functions

#NAME? means Excel found a word in your formula it doesn't recognise. The usual causes are a misspelled function (=SUMM), text without double quotes (=IF(A2>50,Pass,Fail)), a range missing its colon (A2A9), a named range that doesn't exist, or a function your Excel version doesn't have, such as XLOOKUP in Excel 2019.

Errors & fixes· 6 min read

#NUM! Error in Excel

#NUM! means a formula asked for a calculation that can't give a valid number. The most common causes are DATEDIF with the start date after the end date, LARGE or SMALL asking for a position beyond the number of values, the square root of a negative number, and results too big for Excel. Fix the input, such as swapping the dates.

Tests & careers· 6 min read

Excel Skills for Sales and Operations Roles

The key Excel skills for sales and operations roles are totalling revenue by region, rep or product with SUMIF and SUMIFS, calculating percent change and % of total, finding the top order and its rep with MAX and XLOOKUP, totalling by month with date criteria, and flagging stock or targets with IF. Answers should update when data changes.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free