Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Range with no duplicates
Here is my situation: I have a list of college classes. With each class -
lets say ENGL-1301 I need to generate a series of random section numbers with no duplicates between 9001-9099. Then on the next class such as ENGL-1302 I need to start over with the number system. There are different numbers of classes in one class name - lets say ENGL-1301 has 20 sections and ENGL-1302 has 9 sections. Thanks for any help! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Range with no duplicates
This may be the formula you are seeking
=RANDBETWEEN(9001,9099) Skinman "Darmahart" wrote in message ... Here is my situation: I have a list of college classes. With each class - lets say ENGL-1301 I need to generate a series of random section numbers with no duplicates between 9001-9099. Then on the next class such as ENGL-1302 I need to start over with the number system. There are different numbers of classes in one class name - lets say ENGL-1301 has 20 sections and ENGL-1302 has 9 sections. Thanks for any help! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Range with no duplicates
I tried that function, but it does produce duplicates. I can't have duplicate
numbers, but thanks! "Skinman" wrote: This may be the formula you are seeking =RANDBETWEEN(9001,9099) Skinman "Darmahart" wrote in message ... Here is my situation: I have a list of college classes. With each class - lets say ENGL-1301 I need to generate a series of random section numbers with no duplicates between 9001-9099. Then on the next class such as ENGL-1302 I need to start over with the number system. There are different numbers of classes in one class name - lets say ENGL-1301 has 20 sections and ENGL-1302 has 9 sections. Thanks for any help! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Range with no duplicates
In E1 thru E99 enter 9001 thru 9099.
In F1 thru F99 enter =RAND() Sort columns E & F by F If you want three random values, pick E1, E2, and E3 If you want four random values, pick E1, E2, E3, and E4 To re-shuffle, just re-sort -- Gary''s Student - gsnu200799 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Range with no duplicates
U can use this vba code:
Randomize Cells(1, 9) = Int(99 * Rnd + 9001) For i = 2 To 99 Do Stopind = False Randomize x= Int(99 * Rnd + 9001) Set foundCell = Range("I1", _ Range("I1").End(xlDown).Address).Find(x) If Not (foundCell Is Nothing) Then Stopind = True End If Loop Until Not Stopind Cells(i, 9) = x Next -- Ak "Darmahart" wrote: I tried that function, but it does produce duplicates. I can't have duplicate numbers, but thanks! "Skinman" wrote: This may be the formula you are seeking =RANDBETWEEN(9001,9099) Skinman "Darmahart" wrote in message ... Here is my situation: I have a list of college classes. With each class - lets say ENGL-1301 I need to generate a series of random section numbers with no duplicates between 9001-9099. Then on the next class such as ENGL-1302 I need to start over with the number system. There are different numbers of classes in one class name - lets say ENGL-1301 has 20 sections and ENGL-1302 has 9 sections. Thanks for any help! |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Range with no duplicates
Very simple yet effective. Thanks!
"Gary''s Student" wrote: In E1 thru E99 enter 9001 thru 9099. In F1 thru F99 enter =RAND() Sort columns E & F by F If you want three random values, pick E1, E2, and E3 If you want four random values, pick E1, E2, E3, and E4 To re-shuffle, just re-sort -- Gary''s Student - gsnu200799 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Random generator using a range with range frequency | Excel Programming | |||
Look for duplicates within a range | Excel Worksheet Functions | |||
How to generate sets of random numbers without having duplicates | Excel Worksheet Functions | |||
How can I create a list of random numbers with no duplicates? | Excel Discussion (Misc queries) | |||
Showing a unique random number w/o duplicates | Excel Worksheet Functions |