Excel guide · 6 min read
Why your Excel SUM is not adding up correctly
=ROUND(B2*C2*(1-$G$1),2), and the total will match. If the total is off by a larger amount, some numbers are stored as text (SUM skips them) or the range includes hidden or subtotal rows.Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Item | Qty | Unit price | Line total | Discount | 0.12 | |
| 2 | Desk lamp | 3 | 24.99 | 65.9736 | |||
| 3 | A5 notebook | 12 | 3.15 | 33.264 | |||
| 4 | Monitor arm | 2 | 41.5 | 73.04 | |||
| 5 | Cable ties (100) | 5 | 2.79 | 12.276 | |||
| 6 | Desk mat | 4 | 12.49 | 43.9648 | |||
| 7 | Shipping | 1 | 18.50 | 18.5 | |||
| 8 | Return credit | 1 | -15 | -15.00 |
Download this sheet as an Excel practice file (.xlsx)
Off by a cent: the cells hold hidden decimals
The sheet is an office supplies order with a 12% discount in G1. Each line total is quantity times price times (1 - discount), and column D is formatted to 2 decimals. Add the five product lines as they appear on screen, 65.97 + 33.26 + 73.04 + 12.28 + 43.96, and you get 228.51. SUM says 228.52.
Both are "right". Number formatting only changes what a cell shows. The desk lamp line really holds 65.9736 and the cable ties 12.276. SUM adds those full values, gets 228.5184, and the 2-decimal format shows that as 228.52. A calculator, or a person checking the printout, adds the rounded numbers and gets a cent less.
To see what a cell really holds, select it and look at the formula bar, or click Home > Increase Decimal a few times.
Result: 228.5184
228.5184, which shows as 228.52 with 2 decimals. The displayed lines add up to 228.51.
Fix it: round where the value is calculated
Money should be rounded to cents at the step where a cent amount is created, the line total here, not only formatted. Change the line formula to =ROUND(B2*C2*(1-$G$1),2) and fill it down. Now every cell holds exactly what it shows, and SUM returns 228.51, the same as an invoice or a calculator.
If you cannot change the line formulas (a linked sheet, someone else's file), round inside the total instead. SUMPRODUCT rounds each line first and then adds. =SUM(ROUND(D2:D6,2)) does the same in Excel 365 and 2021, but in Excel 2019 and earlier it needs Ctrl+Shift+Enter, so SUMPRODUCT is the safer choice.
Do not just wrap the total in ROUND. =ROUND(SUM(D2:D6),2) still gives 228.52, because it rounds the sum of the unrounded lines.
Result: 228.51
228.51: each line rounded to the cent first, then added, so the total matches the visible lines.
The total does not equal the number you type
Hidden decimals also break checks. =SUM(D2:D6)=228.52 returns FALSE even though the cell shows 228.52, because the stored value is 228.5184. The same thing makes IF tests, conditional formatting and lookups against a total fail for no visible reason.
Compare rounded values instead. =ROUND(SUM(D2:D6),2)=228.52 returns TRUE.
A second, smaller source of this is floating-point arithmetic. Excel stores numbers in binary, so some decimals cannot be stored exactly. =0.5-0.4-0.1 does not return 0 but a tiny negative number, about -2.78E-17. In 2-decimal cells you never see it, but it can make a check for a difference of exactly 0 fail. Rounding the result fixes it the same way.
Result: TRUE
TRUE. Without the ROUND, the comparison returns FALSE.
Off by a larger amount: numbers stored as text
Now total the whole order including shipping and the return credit. SUM(D2:D8) returns 247.0184, about 247.02. It should be 15 less: the return credit in D8 was pasted from a refund email as the text "-15.00". SUM skips text in a range without any warning, so the credit simply vanishes.
Shipping in D7 is fine, even though its price in C7 is also text. Arithmetic (+, -, *, /) converts text that looks like a number, so =B7*C7 returns the number 18.5. SUM does not convert text inside a range. That is why =D7+D8 returns 3.5 while SUM leaves D8 out.
A quick test: =COUNT(D2:D8) counts numbers and returns 6, while =COUNTA(D2:D8) counts filled cells and returns 7. When those two differ, a cell is text. Convert it with the steps in the numbers stored as text guide, then the total drops to 232.02 (232.01 once the lines are rounded to cents).
Result: 247.0184
247.0184: the -15.00 credit in D8 is text and is left out.
Other reasons a total looks wrong
Hidden and filtered rows. SUM adds every row in its range, including rows you hid or filtered out. If you expect the total of what you can see, use =SUBTOTAL(109,D2:D8).
A subtotal inside the range. If the column already has subtotal rows, a SUM over the whole column counts those amounts twice. Use SUBTOTAL for the subtotals and the grand total, because SUBTOTAL skips other SUBTOTAL results in its range.
The range stops short. A total typed or AutoSummed before new rows were added may not include them. Click the total and check the coloured outline on the sheet. Turning the list into a table (Ctrl+T) and using a total row keeps the range growing with the data.
The total does not change at all. If editing a number leaves the total as it was, the workbook is on manual calculation: Formulas > Calculation Options > Automatic.
Set precision as displayed: only if you understand it
Excel has a setting that makes every cell hold exactly what it displays. It fixes the cent problem in one go, and it also permanently throws away the hidden decimals in every constant in the workbook. You cannot get them back by turning the setting off.
It also applies to every sheet in the file, so a rate typed as 0.0375 in a 2-decimal cell becomes 0.04. Use ROUND in your formulas instead. If you do turn it on, save a copy of the file first.
- Go to File > Options > Advanced.
- Scroll to "When calculating this workbook".
- Tick "Set precision as displayed" and click OK on the warning that data will permanently lose accuracy.
Which fix to pick
Off by a cent or two: round each money value where it is calculated with ROUND(...,2). If you cannot touch those formulas, total with SUMPRODUCT(ROUND(range,2)). Off by a round amount that matches one or more cells: check COUNT against COUNTA and convert the text numbers. Total includes rows you cannot see: use SUBTOTAL(109,...). Total does not move when you edit: switch calculation back to Automatic.
Common mistakes
Fixing the cent difference by changing the number format
Formatting only changes the display. Round the value with ROUND(...,2) where it is calculated.
Wrapping only the total in ROUND
=ROUND(SUM(range),2) rounds the sum of unrounded values and can still differ from the visible lines. Round each line, or use =SUMPRODUCT(ROUND(range,2)).
Comparing a total with = and getting FALSE
The stored value has more decimals than you see. Compare =ROUND(total,2)=target.
Trusting a SUM over pasted data
SUM silently skips text. Check that =COUNT(range) equals =COUNTA(range) before you trust the total.
FAQ
Why is my Excel total off by 0.01?
The cells hold more decimals than they show, and SUM adds the full values. Round each value where it is calculated with ROUND(...,2), or total with =SUMPRODUCT(ROUND(range,2)).
Why does Excel's SUM not match my calculator?
You typed the rounded numbers you see into the calculator, while Excel adds the full stored values. Or some cells are text, which SUM skips. Check the formula bar for hidden decimals and compare COUNT with COUNTA.
Why does SUM ignore some numbers?
Those numbers are stored as text, often after pasting from a website, email or export. They usually sit on the left of the cell with a green triangle. Convert them to numbers and SUM will include them.
How do I make SUM only add visible rows?
Use =SUBTOTAL(109,range). It skips rows hidden by a filter and rows you hid by hand.
Should I use "Set precision as displayed"?
Only if you are sure. It permanently removes hidden decimals from the whole workbook, including rates and inputs. ROUND in your formulas fixes the same problem without losing data.
Functions used
SUMAdds numbersROUNDRounds to digitsSUMPRODUCTMultiply then addCOUNTCounts numbersCOUNTACounts non-empty cellsSUBTOTALTotal that skips other subtotals
Related guides
- How to convert numbers stored as text in Excel
- Excel AutoSum selecting the wrong range
- Excel formula not calculating or updating: how to fix it
- How to sum only visible cells in Excel
- How to sum time in Excel
- Excel formulas cheat sheet: the 25 everyone should know
Updated