ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

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

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Errors & fixes
  3. Why Excel Shows 0.30000000000000004 and How to Fix It

Why Excel Shows 0.30000000000000004 and How to Fix It

By ExcelReady Team·Updated November 1, 2026·6 min read

The short answer

Excel stores numbers in binary, and most decimals, like 0.1, can't be stored exactly. So 0.1+0.2 is really 0.30000000000000004 and 0.5-0.4-0.1 can come out as -2.77556E-17 instead of 0. The fix is to round results with ROUND, for example =ROUND(B2*C2,2), and to round both sides before you compare values.

Key takeaways

  • Excel uses binary floating point, so many decimals are stored as a very close approximation.
  • Excel shows at most 15 significant digits, which hides most of these tiny differences.
  • The errors surface in comparisons, IF tests, exact lookups and totals that should be 0.
  • Round money at each calculation step with ROUND(value,2); formatting alone only hides digits.
  • Avoid Set precision as displayed unless you accept that it permanently changes your data.
On this page+
  1. Why 0.1 + 0.2 isn't exactly 0.3
  2. Why you usually don't see it in Excel
  3. Where these tiny errors cause real problems
  4. How to fix it with ROUND
  5. How to compare numbers safely
  6. Why formatting isn't enough
  7. A different rounding error: totals that are off by a cent
  8. Practise it

If you've ever seen a number like 0.30000000000000004, or an Excel rounding error such as -2.77556E-17 where you expected 0, nothing is wrong with your formula. It's a side effect of how computers store decimal numbers, called a floating-point error. This guide explains why it happens, where it causes real problems in Excel, and how to fix it with ROUND.

Why 0.1 + 0.2 isn't exactly 0.3#

Computers store numbers in binary, using only 0s and 1s. Whole numbers convert perfectly, but most decimals don't. Just as 1/3 becomes 0.33333... forever in decimal, 0.1 becomes an endless pattern in binary. The computer has to cut it off, so it stores a number extremely close to 0.1, but not exactly 0.1.

Add two of these approximations and the tiny gaps can show up. 0.1 + 0.2 is stored as 0.30000000000000004. That's the number most programming languages display for this sum.

Excel follows the same standard, called IEEE 754, used by almost all software. So this isn't an Excel bug, and you'll find the same behaviour in other spreadsheets and programs.

Why you usually don't see it in Excel#

Excel displays at most 15 significant digits. The error in 0.30000000000000004 is in the 17th digit, so Excel shows 0.3. Most of the time, the difference is invisible.

It becomes visible when a result should be exactly 0. A well-known example is this formula:

Excel formula
=1*(0.5-0.4-0.1)

You'd expect 0, but in a General-format cell Excel shows -2.77556E-17. That's scientific notation for -0.0000000000000000277556, a tiny leftover from the binary approximations.

The 15-digit limit has a second effect: Excel can't keep more than 15 digits of any number. If you type a 16-digit card or ID number, the last digit becomes 0. Store long IDs as text instead. Very large or impossible results give a different error; see how to fix #NUM!.

Where these tiny errors cause real problems#

A difference of 0.00000000000000004 doesn't matter for a total on screen. It matters when Excel tests for an exact value:

WhereWhat goes wrong
Comparisons=A1=0 returns FALSE when A1 holds -2.77556E-17
IF tests=IF(B6=0,"Paid","Due") says Due on a fully paid invoice
Exact lookupsMATCH or VLOOKUP with FALSE can't find a calculated value
COUNTIFA count of cells equal to 0 misses tiny leftovers
Conditional formattingA "balance is 0" rule doesn't highlight the cell
RemaindersMOD with decimals can leave a tiny remainder instead of 0

Here's a realistic case. An invoice of 100 is paid in three parts:

AB
1ItemAmount
2Invoice100
3Payment 133.33
4Payment 233.33
5Payment 333.34

The balance =B2-B3-B4-B5 looks like 0, but because the payments are decimals, it may be stored as a tiny non-zero number. A test like =IF(B2-B3-B4-B5=0,"Paid","Due") can then return Due. If you work with remainders, the guide to MOD and INT shows the same effect with MOD.

How to fix it with ROUND#

The reliable fix is to round the result to the number of decimals that matter. ROUND changes the stored value, not just how it looks:

Excel formula
=ROUND(B2-B3-B4-B5,2)

This returns exactly 0. Now the status test works:

Excel formula
=IF(ROUND(B2-B3-B4-B5,2)=0,"Paid","Due")

The result is Paid. The syntax is =ROUND(number, num_digits): 2 for cents, 0 for whole numbers. The ROUND function guide also covers ROUNDUP and ROUNDDOWN.

For money, round at each step where a new amount is created, such as tax on a line item: =ROUND(B2*C2,2). Then totals add up to exactly what's shown. The guide to building an invoice with formulas follows this pattern.

How to compare numbers safely#

When you compare two calculated numbers, round both sides to the same number of decimals:

Excel formula
=ROUND(A2,2)=ROUND(B2,2)

Or test whether the difference is very small, using a tolerance (an amount small enough to ignore):

Excel formula
=ABS(A2-B2)<0.000001

ABS removes the minus sign, so the test works whichever number is bigger. Both formulas return TRUE for values that are equal for practical purposes. This matters in IF, COUNTIF and conditional formatting rules.

Why formatting isn't enough#

Formatting a cell to two decimals changes only what you see. The cell may show 0.00, but the stored value is still -2.77556E-17, and every formula that reads the cell uses that stored value. That's why an IF test can fail on a cell that clearly shows 0.00.

Excel has an option called Set precision as displayed (Windows: File > Options > Advanced; Mac: Excel > Preferences > Calculation). It makes Excel store every number exactly as it's shown. But the change is permanent: digits beyond the format are thrown away and can't be recovered. Rounding with formulas is safer, because you choose where it happens and the original data stays intact.

A different rounding error: totals that are off by a cent#

Not every rounding problem is floating point. A common one comes from formatting alone. Say you split 100 three ways with =100/3 in three cells, formatted to two decimals:

CellShowsStored value
B233.3333.3333333333333
B333.3333.3333333333333
B433.3333.3333333333333
Total100.00100

The total is correct, but anyone adding the visible numbers gets 99.99, so the sheet looks wrong. Round each share instead: =ROUND(100/3,2) stores exactly 33.33, and the total becomes 99.99, matching what's shown. Then decide where the missing cent goes, for example by making the last share =B1-B2-B3, where B1 holds the full amount. Now the shares add up to exactly 100.00 on screen and in the formula.

Practise it#

Practise ROUND, ROUNDUP and ROUNDDOWN in a live spreadsheet: you'll round prices, tax and totals and see each result checked instantly. Then practise TRUE and FALSE comparisons to build tests that don't break on tiny differences. Try the invoice exercise on this page first.

Try it yourself

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

The invoice in B2 was paid in three parts (B3:B5). Click B6 and show "Paid" if the rounded balance is 0, or "Due" if not: =IF(ROUND(B2-B3-B4-B5,2)=0,"Paid","Due"). Press Enter.

fx
ABCD
1
Item
Amount
2
Invoice
100
3
Payment 1
33.33
4
Payment 2
33.33
5
Payment 3
33.34
6
Status
7
8
9

Tip: Round the balance to 2 decimals inside the IF test, then compare it with 0.

Practise this in a lesson

LessonROUND, ROUNDUP and ROUNDDOWNControl decimals properly, which isn't the same as formatting.LessonTRUE, FALSE and comparisonsAsk Excel yes-or-no questions with =, <>, >, <, >= and <=, and get TRUE or FALSE back. The building block of every IF.Function guideROUNDRound to decimals, whole numbers or the nearest thousand with Excel's ROUND. Learn when formatting isn't enough, then practice live.

Frequently asked questions

Why does Excel give me a tiny number instead of 0?

+

Decimals like 0.4 and 0.1 can't be stored exactly in binary, so a subtraction that should give 0 can leave a tiny leftover such as -2.77556E-17. Wrap the formula in ROUND to remove it.

Why does Excel say two equal numbers are not equal?

+

One of them probably carries a tiny floating-point difference far past the 15th digit. Compare rounded values, like =ROUND(A2,2)=ROUND(B2,2), or check that the difference is very small with ABS.

How do I stop Excel rounding errors?

+

Round results with ROUND at the point where you calculate them, especially money. Formatting a cell to two decimals only changes the display, not the stored value.

Is this a bug in Excel?

+

No. It's how almost all computer software stores decimal numbers, following the IEEE 754 standard. The same calculation gives the same tiny difference in most programming languages.

Sources

  • ROUND function - Microsoft Support
  • Change formula recalculation, iteration, or precision in Excel - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 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. Why 0.1 + 0.2 isn't exactly 0.3
  2. Why you usually don't see it in Excel
  3. Where these tiny errors cause real problems
  4. How to fix it with ROUND
  5. How to compare numbers safely
  6. Why formatting isn't enough
  7. A different rounding error: totals that are off by a cent
  8. 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

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

#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.

Projects· 6 min read

Create an Invoice in Excel With Formulas

To create an invoice in Excel with formulas, keep a price list on its own sheet and use VLOOKUP to bring each item's description and price into the invoice from its code. Multiply quantity by price for each line, add the lines with SUM, work out tax with ROUND so it shows exact cents, and add a due date by adding the payment terms to the invoice date.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free