问题
Hi I have a list of facilities ID starting from cell E8 and the number of facilities on cell E2. I want to get random Facility IDs from column E8 and transfer to column F (Facility ID PICKED) starting from cell F8. I want this to be automatically if possible, so everytime there is a new desired number(in this case 61) then the random facilities get picked automatically. I was using a formula but then I realized it was bringing me duplicate IDs. I only one each to be picked once.
Please any help will be very appreciated! :)
No facilities: 61
Facility ID Facility ID PICKED
37
47
71
73
77
86
90
96
103
109
111
113
121
130
132
140
161
166
195
206
275
285
353
368
374
384
390
431
449
455
463
467
471
494
503
506
528
533
561
572
576
579
582
584
586
591
608
610
613
615
630
634
648
655
681
699
701
703
715
750
752
756
761
768
778
813
834
850
853
856
862
879
882
885
907
908
942
947
950
960
978
994
1012
1044
1054
1081
1095
1108
1124
1127
1149
1163
1193
1204
1216
1239
1250
1265
1267
1305
1321
1329
1341
1616
1649
1659
1681
1711
1715
1724
1738
1753
1754
1781
1795
1831
1848
1850
1859
1875
1881
1902
1912
1922
1925
1930
1965
1982
1998
2008
2013
2031
2039
2089
2094
2105
2108
2114
2122
2123
2127
2128
2135
2137
2138
2142
2146
2179
2181
2185
2199
2201
2209
2220
2222
2233
2241
2268
2357
2399
2405
2406
2411
2426
2436
2444
2465
2468
2479
2500
2501
2530
2582
2618
2628
2660
2671
2692
2705
2729
2738
2740
2755
2758
2761
2775
2823
2826
2832
2854
2873
2877
2887
2888
2889
2894
2910
2953
2964
2979
2985
2987
2990
2991
3050
3120
3127
3134
3147
3173
3175
3186
3213
3222
3228
3236
3240
3241
3264
3265
3276
3277
3288
3296
3307
3315
回答1:
Put this in F8 and copy down the list.
=IF(ROW(1:1)<=$E$2,AGGREGATE(15,6,$E$8:$E$233/(COUNTIF($F$7:F7,$E$8:$E$233)=0),RANDBETWEEN(1,COUNTA($E$8:$E$233)-ROW(1:1)+1)),"")
来源:https://stackoverflow.com/questions/51936252/randomize-a-list-of-numbers-atomaticaly-without-duplicates-in-excel