Rounding percentages in calculations

CVC

New Member
Joined
Jun 20, 2008
Messages
3
How do you make sure that all values add up to 100% when rounding is involved?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Domski

Well-known Member
Joined
Jan 18, 2005
Messages
7,292
Hi,

As long as you use ROUND and not ROUNDUP or ROUNDDOWN I would always expect them to if they've been calculated correctly in the first place.

I could well be wrong though.

Edit - Which I obviously am having tried it. Question - Why round the percentages in the first place?

Dom
 
Last edited:
Upvote 0

Mike Blackman

Well-known Member
Joined
Jun 8, 2007
Messages
2,494
Hi,

How many percentages are you working with?

EDIT. HI Domski, unfortunately using round it is possible not to get exactly 100%.
 
Upvote 0

Jon von der Heyden

MrExcel MVP, Moderator
Joined
Apr 6, 2004
Messages
10,894
Office Version
  1. 365
Platform
  1. Windows
You could round all but one of your percentages to say 2 decimal places. Then calculate the final percentage as =1-SUM(A1:A100) ...where A1:A100 are the rounded percentages. If all percentages are rounded to 2 places then this result will also be.

Nothing like a bit of reverse engineering ;)

Regards
Jon
 
Upvote 0

Mike Blackman

Well-known Member
Joined
Jun 8, 2007
Messages
2,494
If you only have two or three percentages you could use something hideous like this, it does the trick though.

=IF(AND(MID(A1,(FIND(".",A1)+3),3)>MID(A2,(FIND(".",A2)+3),3),MID(A1,(FIND(".",A1)+3),3)>MID(A3,(FIND(".",A3)+3),3)),ROUND(A1,2)+0.01,ROUND(A1,2))

=IF(AND(MID(A2,(FIND(".",A2)+3),3)>MID(A1,(FIND(".",A1)+3),3),MID(A2,(FIND(".",A2)+3),3)>MID(A3,(FIND(".",A3)+3),3)),ROUND(A2,2)+0.01,ROUND(A2,2))

=IF(AND(MID(A3,(FIND(".",A3)+3),3)>MID(A1,(FIND(".",A1)+3),3),MID(A3,(FIND(".",A3)+3),3)>MID(A2,(FIND(".",A2)+3),3)),ROUND(A3,2)+0.01,ROUND(A3,2))

I wouldn't normally post something like this, but it took me so long I just had to.
 
Upvote 0

Forum statistics

Threads
1,195,749
Messages
6,011,437
Members
441,614
Latest member
TiaGtz

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
Top