Formula for numbers of distribution as per %...into specific roundup

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,362
Office Version
  1. 2010
Using Excel 2010

Hello,

Code:
Formula In cell C10…=RAND() and copied to down C19

Formula In cell D10…=C10/SUM(C$10:C$19) and copied to down D19

Formula In cell E10 =$E$7*D10 and copied to down E19

Here below is a layout without formulas (because as F9 is pressed or any entry done value changes I have put formulas apart sorry for the trouble) in which column “E” cells E10:E19 this is a result of 20 numbers are in the cell E7, as per % of the column “D” cells D10:D19 and it sums total 20 shown in the E9.

What I need A formulas in the cells G, H, And I

1-G10:G19 so the distribution of the 20 numbers could be in (0.20, 0.40, 0.60, 0.80 and 1.0) as shown. Note: the total always must be 20 matches with E7 numbers

2-1-H10:H19 so the distribution of the 20 numbers could be in (0.25, 0.50, 0.75 and 1.0) as shown. Note: the total always must be 20 matches with E7 numbers

3-1-I10:I19 so the distribution of the 20 numbers could be in (0.50 and 1.0) as shown. Note: the total always must be 20 matches with E7 numbers

Is it possible?

Excel Question-New.xlsm
ABCDEFGHIJK
1DistributionDistributionDistribution
2Increase ByIncrease ByIncrease By
30,200,250,50
40,400,501,00
50,600,75
6Distribution0,801,00
720,001,00
8
9NumbersRand %100,00%20,0020,0020,0020,00
1010,8170828413,59%2,722,602,502,50
1120,066590381,11%0,220,300,250,25
1230,462266287,69%1,541,401,501,50
1340,8853985214,72%2,943,003,003,00
1450,46784867,78%1,561,601,501,50
1560,9952014116,55%3,313,303,253,50
1670,6666060611,08%2,222,202,252,00
1780,9514973915,82%3,163,203,253,25
1890,15194922,53%0,510,600,750,50
19100,549376499,14%1,831,801,752,00
20
21
22
Sheet5


Please need help

Thank you all.

Regards,
Moti
 
Hello Moti,

Instead of Rand() you could maybe use something like Max(0.1,Rand()). But keep in mind that you would change the shape of the random distribution.

Regards,
Bernd
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hello Moti,

Instead of Rand() you could maybe use something like Max(0.1,Rand()). But keep in mind that you would change the shape of the random distribution.

Regards,
Bernd
Wow! Sulprobil, that is spot-on! Results are like a charm!

Note: changing the “Rand() to Max(0.1,Rand())” I noticed that if there are 10 numbers distribution to avoid the result “0.00” need to put distribution number in the cell E7 +1 more Instead 10…11 then all it works perfect

I appreciate your patience help and time you spend till solving end. (y) 🍻

Good Luck

Here below are the best results of your solution.

Cell Formulas
RangeFormula
E9,G9:I9E9=SUM(E10:E19)
G10:I19G10=RoundToSum($E$10:$E$19*G2,0)/G2
C10:C19C10=MAX(0.1,RAND())
D10:D19D10=C10/SUM(C$10:C$19)
E10:E19E10=$E$7*D10
Press CTRL+SHIFT+ENTER to enter array formulas.



Kind Regards,
Moti :)
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,215,355
Messages
6,124,468
Members
449,163
Latest member
kshealy

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