Excel Help - Random Generation

minendo

Elite Member
Aug 31, 2001
35,560
22
81
I've got a spreadsheet with x number of pieces of equipment all labeled with a number 1 through x. What function can I use to randomly select 12 different values of x?
 

dderolph

Senior member
Mar 14, 2004
619
0
0
The question really doesn't make sense. How could you have "12 different values of x"? x would represent one value, right? Do you really mean you want to randomly select 12 values BETWEEN 1 and x, x being the last/highest number in the inventory?
 

minendo

Elite Member
Aug 31, 2001
35,560
22
81
Originally posted by: dderolph
The question really doesn't make sense. How could you have "12 different values of x"? x would represent one value, right? Do you really mean you want to randomly select 12 values BETWEEN 1 and x, x being the last/highest number in the inventory?
I want 12 different results of x to be returned. These 12 values will then coincide with equipment for testing.

 

CPA

Elite Member
Nov 19, 2001
30,322
4
0
Go to Tools -> Data Analysis. Choose Random Number Generation. Put in the parameters (distribution should be Uniform). It will return the cell numbers, though, not the actual value set to each piece of equipment.

If you need Data Analysis, choose Tools -> Add-ins -> Analysis Toolpak.

Hope that is what you are looking for.
 

minendo

Elite Member
Aug 31, 2001
35,560
22
81
Originally posted by: CPA
Go to Tools -> Data Analysis. Choose Random Number Generation. Put in the parameters (distribution should be Uniform). It will return the cell numbers, though, not the actual value set to each piece of equipment.

If you need Data Analysis, choose Tools -> Add-ins -> Analysis Toolpak.

Hope that is what you are looking for.
Will I have to do this everytime I want 12 random cells? I am looking to have 12 different values randomly generated everytime I open the spreadsheet.

 

minendo

Elite Member
Aug 31, 2001
35,560
22
81
Figured it out. I just used =rand()*(b-a)+a, where b=total number of entries and a=lowest number of entries. Then all I had to do was format it to display no decimals. :)