Confident CellsExcel practice Start free

The #DIV/0! error in Excel: what it means and how to fix it

Updated 26 November 2026 · 5 min read

#DIV/0! means a formula divided by zero. Most often the cell it divides by is 0 or empty, because the number isn't in yet, and Excel counts an empty cell as 0. Fix the data if it's wrong, or show a blank or a dash instead with =IF(C2=0,"",B2/C2). It means the same in every version of Excel, on Windows and Mac and in Excel for the web.

Causes and fixes at a glance

What you seeWhyFix
#DIV/0! on some rows of a columnThe cell you divide by holds 0=IF(C2=0,"-",B2/C2)
#DIV/0! on rows still being filled inThe cell you divide by is empty, which counts as 0The same IF, or type the missing number in
A total or average shows #DIV/0!One of the cells it uses has the errorFix that cell, and the total works again
AVERAGE or AVERAGEIF gives #DIV/0!There are no numbers to average, or no rows match=IFERROR(AVERAGEIF(…),"None yet")
A percentage change gives #DIV/0!The old figure was 0=IF(B2=0,"New",(C2-B2)/B2)

Each one is worked through below on a small sheet.

A worked example

A café works out its average spend per customer for each day: the takings divided by the number of customers.

ABCD
1DayTakingsCustomersPer customer
2Mon£318.0053£6.00
3Tue£0.000#DIV/0!
4Wed£402.0067£6.00
5Thu£275.00#DIV/0!
6Average#DIV/0!
D2 holds =B2/C2, copied down to D5. Tuesday's customers are 0 and Thursday's are blank, so D3 and D5 show #DIV/0!, and so does the average in D6.

Excel is right: there's no answer to work out. But the error looks broken, and it spreads. The average in D6 uses D3 and D5, so it shows #DIV/0! too, and so would anything that used D6.

Show a blank or a dash: IF

Check the number you're dividing by first. If it's 0 (an empty cell counts as 0), show nothing; otherwise divide:

=IF(C2=0,"",B2/C2)
ABCD
1DayTakingsCustomersPer customer
2Mon£318.0053£6.00
3Tue£0.000-
4Wed£402.0067£6.00
5Thu£275.00-
6Average£6.00
D2 holds =IF(C2=0,"-",B2/C2), copied down to D5. The shut day and the missing count show a dash, and the average in D6 works again.

The average now works: AVERAGE and SUM skip the dashes, because they're text, so D6 is the average of Monday and Wednesday, £6.00. When Thursday's count is typed in, its row fills itself in.

If you'd rather show 0, put 0 in place of the dash. Think about who reads it, though: a 0 looks like customers who spent nothing, and it pulls the average down.

IF or IFERROR?

IFERROR also hides it: =IFERROR(B2/C2,"-"). The difference is what else it hides. Here someone has typed TBC in Wednesday's takings:

ABCDE
1DayTakingsCustomersWith IFWith IFERROR
2Mon£318.0053£6.00£6.00
3Tue£0.000--
4WedTBC67#VALUE!-
D2 holds =IF(C2=0,"-",B2/C2) and E2 holds =IFERROR(B2/C2,"-"), both copied down. IF still shows #VALUE! for the TBC in B4. IFERROR turns it into a dash, as if the café had been shut.

For dividing, IF is usually the better choice, because a 0 is the only error you expect. The #VALUE! error guide covers the TBC kind of problem.

An average of no rows

=AVERAGE(D2:D5) gives #DIV/0! if none of the cells hold a number: an average is a total divided by a count, and the count is 0. AVERAGEIF and AVERAGEIFS do the same when no rows match. Here the East team has no sales yet, so there's nothing to average:

ABCDEF
1TeamSaleTeamAverageSafe average
2North£1,200.00North£950.00£950.00
3South£800.00South£900.00£900.00
4North£950.00East#DIV/0!None yet
5South£1,000.00
6North£700.00
E2 holds =AVERAGEIF($A$2:$A$6,D2,$B$2:$B$6), copied down. F2 counts the team's rows with COUNTIF first and only averages them if there are some.

North has three sales, £1,200, £950 and £700, which add up to £2,850, and £2,850 ÷ 3 = £950. East has none, so its average would be £0 ÷ 0. The safe version counts the rows first:

=IF(COUNTIF($A$2:$A$6,D4)=0,"None yet",AVERAGEIF($A$2:$A$6,D4,$B$2:$B$6))

=IFERROR(AVERAGEIF($A$2:$A$6,D4,$B$2:$B$6),"None yet") is shorter and gives the same here. The COUNTIF way only catches "no rows", so a mistake elsewhere in the formula still shows.

Percentage change from zero

Change from last year is (this year − last year) ÷ last year. Pens went from £400 to £500, so the change is £100, and £100 ÷ £400 = 25%. Mugs are new this year, so last year was £0, and there's no percentage to give: dividing by 0 again.

ABCDE
1ProductLast yearThis yearChangeSafe change
2Pens£400.00£500.0025%25%
3Mugs£0.00£120.00#DIV/0!New
4Bags£250.00£200.00-20%-20%
D2 holds =(C2-B2)/B2 and E2 holds =IF(B2=0,"New",(C2-B2)/B2), both copied down. Mugs sold nothing last year, so D3 shows #DIV/0! and E3 says New.

A word such as New says more than a blank here. There's more on working out changes in percentages in Excel.

Other places it turns up

Dividing by a formula's answer

If the number you divide by comes from another formula, click that cell and check what it really holds. A 0 gives #DIV/0!. A formula that shows "" looks empty too, but dividing by it gives #VALUE! instead, because "" is text.

MOD with 0

=MOD(A2,0), the remainder after dividing by 0, gives #DIV/0! for the same reason.

Finding every error on a sheet

Press Ctrl+G (on a Mac, Control+G) to open Go To, click Special, choose Formulas and tick only Errors. Excel selects every cell showing an error, so you can see where they are before you decide how to fix them. To follow one back to the cell it starts from, click it and use Trace Precedents: see formula auditing.

Try it now

Your turn

In D2, work out the spend per customer: the takings divided by the customers. Where there are no customers (0 or blank), show a dash, "-", instead of #DIV/0!. Your formula will be copied down to D8.

ABCD
1DayTakingsCustomersPer customer
2Mon£318.0053
3Tue£0.000
4Wed£402.0067
5Thu£275.00
6Fri£96.000
7Sat£0.0012
8Sun£615.0082

Open this in Try a formula: the same sheet with the answer filled in, to change or share by link.

Part of Excel data analysis practice: every lesson on the topic, with a project in Excel.

Where it works

#DIV/0! and the IF fix work the same in every version of Excel, on Windows and Mac, and in Excel for the web. IFERROR needs Excel 2007 or later.

Questions

What does #DIV/0! mean in Excel?

It means a formula tried to divide by zero, which has no answer. Usually the cell it divides by holds 0, or is empty, because Excel counts an empty cell as 0. AVERAGE gives it too when there are no numbers to average. The formula is often fine: the number it needs just isn't there yet. Check the cell you divide by, then fill it in or catch the 0 with IF.

How do I show a blank instead of #DIV/0!?

Check the cell you divide by before dividing: =IF(C2=0,"",B2/C2). When C2 is 0 or empty, the cell shows nothing; otherwise you get the usual answer. Put "-" in place of "" for a dash, or 0 for a zero. =IFERROR(B2/C2,"") also works, but it hides every other error too, such as text typed into a number column.

Why does AVERAGE give #DIV/0!?

An average is the total divided by how many numbers there are. If the range has no numbers in it, only blanks or text, that count is 0, so AVERAGE divides by 0. AVERAGEIF and AVERAGEIFS do the same when no rows match. Count first, then average: =IF(COUNT(B2:B9)=0,"",AVERAGE(B2:B9)), or use COUNTIF with the same condition for AVERAGEIF.

Should I use IF or IFERROR to fix #DIV/0!?

For dividing, IF is usually better: =IF(C2=0,"-",B2/C2) catches only the 0 you expect, so other mistakes such as a word typed in place of a number still show as an error. IFERROR hides every error with the same message. Use IFERROR when any error means the same thing, or when the formula is already checked and you just want a tidy sheet.