Here's a revised formulas set up which now allows *all* 16 values within
A1:A16 to be distributed randomly within K1:K100 by the number of times
indicated in col B.
Revised sample construct available at:
http://www.savefile.com/files/8028542
RandomizingColValuesByFixedNoOfTimes_v2.xls
In C1: =IF(B1="","",B1+ROW()/10^10)
In D1:
=IF(ISERROR(SMALL($C:$C,ROW())),"",
INDEX(A:A,MATCH(SMALL($C:$C,ROW()),$C:$C,0)))
Copy D1 to E1
Select C1:E1, fill down to E16
C1:C16 acts as an arb tie-breaker col,
in case identical values are specified in col B
Cols D and E extracts neatly the 3 values in col A
and corresponding times to repeat in col B to the top
(above as before, no change)
In B17: =IF(SUM(B1:B16)>100,">100, re-do!","")
(B17 is just to provide a visual check
that the total in B1:B16 does not exceed the number of cells in K1:K100)
In F1:
=
IF(ROW()>$E$1,
IF(ROW()>SUM($E$1:$E$2),
IF(ROW()>SUM($E$1:$E$3),
IF(ROW()>SUM($E$1:$E$4),
IF(ROW()>SUM($E$1:$E$5),G1,
OFFSET($D$5,INT((ROW()-ROW())/$E$5),)),
OFFSET($D$4,INT((ROW()-ROW())/$E$4),)),
OFFSET($D$3,INT((ROW()-ROW())/$E$3),)),
OFFSET($D$2,INT((ROW()-ROW())/$E$2),)),
OFFSET($D$1,INT((ROW()-1)/$E$1),))
In G1:
=
IF(ROW()>SUM($E$1:$E$6),
IF(ROW()>SUM($E$1:$E$7),
IF(ROW()>SUM($E$1:$E$8),
IF(ROW()>SUM($E$1:$E$9),
IF(ROW()>SUM($E$1:$E$10),H1,
OFFSET($D$10,INT((ROW()-ROW())/$E$10),)),
OFFSET($D$9,INT((ROW()-ROW())/$E$9),)),
OFFSET($D$8,INT((ROW()-ROW())/$E$8),)),
OFFSET($D$7,INT((ROW()-ROW())/$E$7),)),
OFFSET($D$6,INT((ROW()-ROW())/$E$6),))
In H1:
=
IF(ROW()>SUM($E$1:$E$11),
IF(ROW()>SUM($E$1:$E$12),
IF(ROW()>SUM($E$1:$E$13),
IF(ROW()>SUM($E$1:$E$14),
IF(ROW()>SUM($E$1:$E$15),I1,
OFFSET($D$15,INT((ROW()-ROW())/$E$15),)),
OFFSET($D$14,INT((ROW()-ROW())/$E$14),)),
OFFSET($D$13,INT((ROW()-ROW())/$E$13),)),
OFFSET($D$12,INT((ROW()-ROW())/$E$12),)),
OFFSET($D$11,INT((ROW()-ROW())/$E$11),))
In I1:
=IF(ROW()>SUM($E$1:$E$16),"",
OFFSET($D$16,INT((ROW()-ROW())/$E$16),))
In J1: =RAND()
In K1: =INDEX(F:F,RANK(G1,$G$1:$G$100))
Select F1:K1, fill down to K100
F1:F100 returns a col of the numbers within D1

16,
repeated by the number of times indicated in E1:E16
(The subsequent IFs in cols G, H, I covers the full range
and auto-"collapses" back to col F)
J1:J100 provides the randomization "base"
K1:K100 returns a random shuffle of F1:F100,
which yields the desired results
Just press F9 to regenerate afresh
the random distribution in K1:K100
---