largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
I'm wondering how this might be possible either via VBA or fancy formula work...
Essentially I'd like to get to a specific value when using a percent to total calculation, but because of rounding I'm slightly off...is there any way to make sure we get to the specific value?
For Example:
I want to divide 55 coins among 4 people based on the below percentages:
Person1 = 10%
Person2 = 20%
Person3 = 30%
Person4 = 40%
When I round in Excel I get
10% * 55 = 5.5 which rounds to = 6
20% * 55 = 11
30% * 55 = 16.5 which rounds to = 17
40% * 55 = 22
6+11+17+22 = 56 which is 1 more than 55.
Ideally, I would like the formula or VBA take the 1 unit from the highest recipient or x number of highest recipients. IE - in another example, if I am over by 3 units then I would want to take 1 unit each from the top 3 recipients.
Does this make sense?
Any ideas how to accomplish this?
Thanks in advance!
Essentially I'd like to get to a specific value when using a percent to total calculation, but because of rounding I'm slightly off...is there any way to make sure we get to the specific value?
For Example:
I want to divide 55 coins among 4 people based on the below percentages:
Person1 = 10%
Person2 = 20%
Person3 = 30%
Person4 = 40%
When I round in Excel I get
10% * 55 = 5.5 which rounds to = 6
20% * 55 = 11
30% * 55 = 16.5 which rounds to = 17
40% * 55 = 22
6+11+17+22 = 56 which is 1 more than 55.
Ideally, I would like the formula or VBA take the 1 unit from the highest recipient or x number of highest recipients. IE - in another example, if I am over by 3 units then I would want to take 1 unit each from the top 3 recipients.
Does this make sense?
Any ideas how to accomplish this?
Thanks in advance!