Forum Discussion
Spike_01
Dec 05, 2024Copper Contributor
excel calculation not equalling what it should?
I have a simple spreadsheet or at least I thought it was! I have cell E12 which is a formulated figure £61.99 Cell F12 is the amount paid £62.00 cell G12 is sum of F12-E12, which gives result of 0.0...
- Dec 12, 2024
Change the formula to
=IF(F13<>"", ROUND(F13-E13, 2), "")
or
=IF(F13<>"", ROUND(F13, 2)-ROUND(E13, 2), "")
JKPieterse
Dec 11, 2024Silver Contributor
Under the hood Excel uses more decimals for calculation than it shows in the cell (depending on the number format of the cell that is).
If E12 and F12 are the result of a calculation, they may actually contain 61.98500001 and 62.004321 respectively.
If you subtract those two numbers you end up with 0.0193209899999971, rounded to two decimals that is 2 cents.
Before subtracting both values, you must round them to two decimals if you want the cents to match up.
=ROUND(F12,2)-ROUND(E12,2)
should give you the correct number.