LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default Allocating percentages

"Fred Smith" wrote:
I have percentages in B2:B30 which add up to 100%,
and an amount to allocate in A2 (for example, 8).
However, the results must be integers, and must add up to A2. The simple
formula is =round($A$2*B2,0)
copied down, but the rounding doesn't always produce
the right total. How do I ensure that the total always
equals A2?


I believe I already answered that in Lilyput's thread. I'll paraphrase....

This is a common quantization problem, i.e. the result of rounding "long"
decimal fractions to fewer decimal places (or integers). There are no
perfect solutions.

Consider the following simple example. You have 3 dollar bills, and you
want to award them to 4 people in the proportion to their contributions,
which is 25% each. It can't be done! At least, not fairly. Someone must
get zero.

One simple (but flawed) approach is to put the following formulas into C2
and C3, say, and copy C3 down through C30:

C2: =ROUND($A$2*B2,0)

C3: =MIN($A$2 - SUM($C$2:C2), ROUND($A$2*B3,0))

That approach is flawed because it is more unfair to the people represented
by the later cells.

We might ameliorate the unfairness by randomizing B2:B30 (and associated
columns), using the formula above, then reordering C2:C30 according to the
original order. I would use a UDF for that.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allocating remainders ramtroop Excel Worksheet Functions 2 October 16th 08 10:35 PM
Allocating the numbers from the total srpavar Excel Worksheet Functions 1 July 21st 08 07:04 AM
Allocating usage across aging buckets Adrian1962 Excel Worksheet Functions 0 April 16th 08 05:21 AM
Allocating a value from a cell babygoode Excel Worksheet Functions 2 August 9th 05 10:24 PM
Allocating a Value Raymond Gallegos Excel Worksheet Functions 1 January 7th 05 01:10 AM


All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"