Quantcast
Channel: Active questions tagged worksheet-function - Super User
Viewing all articles
Browse latest Browse all 994

Distribution in Excel using rounding

$
0
0

I have a bag of 15 cookies of 100 calories each. The members in my family are to be distributed cookies based on a recommended calorie allocation. These values are:

PersonCalorie AllocationCookies
A2032
B1662
C2402
D2312
E2152
F1682
G1451
H1331

Notice that the sum of the calorie allocation column is 1500, the same as the total calories of the bag of cookies.

We would like to round the cookie allocation to the nearest full cookie, so we don't have to break any cookies in half or by some other fraction. In my spreadsheet, I use the MROUND function in the formula =MROUND(B2,100). However, because of the rounding error, the sum of the Units column is 14, even though there are 15 cookies. This is a problem.

Intuitively, I would think that Person G should get the remaining cookie because her deserved calorie allocation (145) is 45% over the realized calorie allocation (100) and this percentage difference is higher than any other family member. Does that make sense or am I wrong?

Is there a formula that I can use that would distribute with no rounding error? That is, there will never be one unit short nor one unit in excess. MROUND clearly can't account for this rounding error on its own.


Viewing all articles
Browse latest Browse all 994

Trending Articles