rounding error

winde

New Member
Joined
Nov 27, 2018
Messages
32
Hi, i'm facing an issue with rounding error and i would like to know if there is a way to solve it.
below is an simple example.

[TABLE="width: 490"]
<colgroup><col style="text-align: center;"><col style="text-align: center;"><col style="text-align: center;"><col span="3" style="text-align: center;"></colgroup><tbody>[TR]
[TD="align: center"]quantity[/TD]
[TD="align: center"]a[/TD]
[TD="align: center"]b[/TD]
[TD="align: center"]c[/TD]
[TD="align: center"]d[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]50[/TD]
[TD="align: center"]35%[/TD]
[TD="align: center"]21%[/TD]
[TD="align: center"]16%[/TD]
[TD="align: center"]28%[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]using int formula[/TD]
[TD="align: center"]17[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]49[/TD]
[/TR]
[TR]
[TD="align: center"]using round formula[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]8[/TD]
[TD="align: center"]14[/TD]
[TD="align: center"]50[/TD]
[/TR]
</tbody>[/TABLE]

but technically, 18+11+8+14=51

so how can i get exact 50 quantity?

Thanks.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Round just does that, up or down by the result, finacial rounding is even more erractic. The results you are getting are what really happens. Just looking at the values 18 is half of 36 and 11 half of 22
 
Last edited:
Upvote 0
There is no way to solve what you have there. The only way for the numbers to total the 50 is if you dont round them. Rounding can produce totals that differ slightly than the original total. You could format them to look like integers whilst retaining their underlying value. All depends what you are using it for.
 
Upvote 0

Forum statistics

Threads
1,223,981
Messages
6,175,767
Members
452,668
Latest member
mrider123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top