View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chiranth Chiranth is offline
external usenet poster
 
Posts: 1
Default Pick Ref# randomly on an average

Ok, I have

Col A Col B
Ref# Status
31850261 ABC
32430586 MNO
31946557 MNO
32118825 MNO
32455687 MNO
32455477 XYZ
32430517 XYZ
31850189 UTV
32430664 ABC
32323468 MNO
32116014 XYZ
32490083 XYZ
32504837 UTV
32505148 ABC
32505411 MNO
32505828 XYZ
32513272 XYZ
32564298 UTV
32579326 ABC

Col C

1
1
2
3
4
1
2
1
2
5
3
4
2
3
6
5
6
3
4

Col E Col F Col G Col H

ABC 4 0.210526316 2
XYZ 6 0.315789474 3
MNO 6 0.315789474 3
UTV 3 0.157894737 2

So, I have 19 ref# as above and Total ABC=4, XYZ=6, MON=6, UTV=3.. I
want 10 random ref# (which are unique) to be picked in which ABC &
UTV=2, XYZ & MNO=3 (as per col H)

How do I do this?

Thanks



On Feb 18, 8:29*pm, Max wrote:
Believe my interp & yours on your original core issues are quite different

But, when I press F9 proportion differs each time ..


Of course, isn't the choosing of the names supposed to be random? The
"weightage" factor is still there, ie in the cumulative weightage range H2:H4
which provides the proportional reference/base for the name randomization
process. For example, XYZ has a 42% chance of being "picked" compared to
ABC's 33% and MNO's 25%. This 42% chance is actualized via its spread: 58% -
100%, ie any random num generated by RAND() [in col J] between 0.58 to 1.0
will "pick" XYZ as the random name. ABC and MNO has correspondingly lower
spreads: 0 - <33% (33%), and 33% - <58% (25%), hence are proportionately less
likely to be picked compared to XYZ by RAND()'s generation. And only after
the name israndomlychosen, would theref#s associated with it berandomly
selected using randbetween.

If you don't want the names to berandomlychosen, then just allocate the
names by their ratios in F2:F5. In the sample, clear cols H, J and K.
Manually enter a mix of the 3 names into K2:K6, duplicating each name to
correspond roughly to their ratios in F2:F5. The rest of the set up/model
execution remains unchanged.

--
Max
Singaporehttp://savefile.com/projects/236895
Downloads:23,500 Files:370 Subscribers:66
xdemechanik
---

"Kashyap" wrote:
Hi Max,


Proportional numbers what I got in col F are as below.


ABC * * * *6
XYZ * * * * * * * *6
MNO * * * *4
UTV * * * *3


But, whan I press F9 proportion differs each time as below..


1
4
2
4


4
5
2
0


7
1
3
0


1
6
2
2


I tried this for 15 random number out of 19.. What I need is that
proprotions should not change..


ABC * * * *6
XYZ * * * *6
MNO * * * *4
UTV * * * *3


Thanks..