What's new
Fantasy Football - Footballguys Forums

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Number generator/excel guys? Possible (1 Viewer)

Gottabesweet

Footballguy
I'm running a pool where there's 100 squares. 10 people each get 10 of the spots that have pre filed in answers. Is there a generator that will pick numbers 1-100 and then remove that picked number?

 
Enter a column of #s 1-100.

In the adjacent column enter =randbetween(1,10000) and copy it down 100 cells.

Then sort the first column using the values in the 2nd.

Not sure if that's what you're looking for?

 
Last edited by a moderator:
RANDBETWEEN won't prevent duplicates from being chosen.

Put the names in cells A1-A100 (all 10 names, 10 times each).

Put numbers 1-100 in column B1-B100.

In cells C1-C100 enter =RAND() .

Sort by column B and C only (highlight C and B before sorting).

The result should randomly sort the numbers in column B which will give each person a set of 10 random/unique numbers.

 
Here's your answer. This script will create a random number between 1 - 100, throw it in row C1 - C100, and will not allow duplicates.

Dim MY_RND_NO(101) As Variant
Sub CREATE_RANDOM()
Randomize
Range("C1:C100").ClearContents
MY_COUNT = 1
Do Until MY_COUNT = 101
NEW_NUMBER = Int(Rnd() * (101 - 1) + 1)
If MY_RND_NO(NEW_NUMBER) <> "USED" Then
Range("C" & MY_COUNT).Value = NEW_NUMBER
MY_RND_NO(NEW_NUMBER) = "USED"
MY_COUNT = MY_COUNT + 1
End If
Loop
End Sub
Just go into Developer mode within Excel. Click Insert - Module. Copy and paste the above into the module. Then go to "Run" at the top (still within developer mode) and click the first option.

Then when you go back into your excel sheet you should have your numbers 1-100 randomly distributed between C1-C100 (of course we can change which column this goes into pretty easily by modifying the VB above) if C isn't the right spot for it.

 
RANDBETWEEN won't prevent duplicates from being chosen.

Put the names in cells A1-A100 (all 10 names, 10 times each).

Put numbers 1-100 in column B1-B100.

In cells C1-C100 enter =RAND() .

Sort by column B and C only (highlight C and B before sorting).

The result should randomly sort the numbers in column B which will give each person a set of 10 random/unique numbers.
The way I set up the first column will prevent dupes from being selected.

 
RANDBETWEEN won't prevent duplicates from being chosen.

Put the names in cells A1-A100 (all 10 names, 10 times each).

Put numbers 1-100 in column B1-B100.

In cells C1-C100 enter =RAND() .

Sort by column B and C only (highlight C and B before sorting).

The result should randomly sort the numbers in column B which will give each person a set of 10 random/unique numbers.
The way I set up the first column will prevent dupes from being selected.
Yeah, I completely misread your post! We basically did the same thing.

 

Users who are viewing this thread

Back
Top