Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
topkick
 
Posts: n/a
Default I need to randomize a column of alphanumeric employee ID's for a .

I have a column of employee id's that have alpha numeric characters I need to
pull a random sampling for a drug test how do I do it? I tryed rand() and
Randbetween and no luck making that work.
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
in B1 put
=RAND()
copy this down for all rows
Now sort with column B and pick from column A the number of required
IDs.
With resorting you get a new sample

--
Regards
Frank Kabel
Frankfurt, Germany


topkick wrote:
I have a column of employee id's that have alpha numeric characters I
need to pull a random sampling for a drug test how do I do it? I
tryed rand() and Randbetween and no luck making that work.


  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

If your values are in A1:A100, enter =RAND() in B1 and copy down to
B100. Select a cell in column B and choose Data/Sort, sorting on column
B. Take the first N alphanumerics in column A, where N is the number of
samples.

Alternatively, to do it without sorting:

If you enter the RandInt User Defined Function found he

http://www.mcgimpsey.com/excel/randint.html

If your alphanumerics are in A1:A100, then to pull 15 samples, select
B1:B15 and array-enter

=INDEX(A:A,RandInt(1,100))


In article ,
"topkick" wrote:

I have a column of employee id's that have alpha numeric characters I need to
pull a random sampling for a drug test how do I do it? I tryed rand() and
Randbetween and no luck making that work.

  #4   Report Post  
topkick
 
Posts: n/a
Default

I tried the INDex and get a #name? error

"JE McGimpsey" wrote:

One way:

If your values are in A1:A100, enter =RAND() in B1 and copy down to
B100. Select a cell in column B and choose Data/Sort, sorting on column
B. Take the first N alphanumerics in column A, where N is the number of
samples.

Alternatively, to do it without sorting:

If you enter the RandInt User Defined Function found he

http://www.mcgimpsey.com/excel/randint.html

If your alphanumerics are in A1:A100, then to pull 15 samples, select
B1:B15 and array-enter

=INDEX(A:A,RandInt(1,100))


In article ,
"topkick" wrote:

I have a column of employee id's that have alpha numeric characters I need to
pull a random sampling for a drug test how do I do it? I tryed rand() and
Randbetween and no luck making that work.


  #5   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
do you use a English excel version?

--
Regards
Frank Kabel
Frankfurt, Germany

"topkick" schrieb im Newsbeitrag
...
I tried the INDex and get a #name? error

"JE McGimpsey" wrote:

One way:

If your values are in A1:A100, enter =RAND() in B1 and copy down to
B100. Select a cell in column B and choose Data/Sort, sorting on

column
B. Take the first N alphanumerics in column A, where N is the

number of
samples.

Alternatively, to do it without sorting:

If you enter the RandInt User Defined Function found he

http://www.mcgimpsey.com/excel/randint.html

If your alphanumerics are in A1:A100, then to pull 15 samples,

select
B1:B15 and array-enter

=INDEX(A:A,RandInt(1,100))


In article ,
"topkick" wrote:

I have a column of employee id's that have alpha numeric

characters I need to
pull a random sampling for a drug test how do I do it? I tryed

rand() and
Randbetween and no luck making that work.





  #6   Report Post  
Shannon W.
 
Posts: n/a
Default

Hi, sorry to question you on someone else's question, but it's relevant. I
tried your method for rand and I some amount of success. I get the sheet to
put out a random number (0 or 1). I also was able to assign this random
function to a macro button so I could just click the button. Finally, I
learned how to get a number other than 0 or 1. I then tried to use this in
conjunction with the vlookup formula. The problem I encountered with this,
is vlookup see the random number generated, however that random number is not
exact. Example, I have the following "test" sheet:

1 Red
2 Blue
3 Green
4 Orange

Now, I have it set to =rand()*(4-0)+1, which will give me a random number,
1-4. When I generate a number, let's say 3, it gives a random number between
3.0000-3.9999 (just for the number 3 of course, it will generate 1.000-1.999,
etc.) I tryed to find something in the format cell, but none of the choices
in the "Number" tab works. Any help?

"Frank Kabel" wrote:

Hi
in B1 put
=RAND()
copy this down for all rows
Now sort with column B and pick from column A the number of required
IDs.
With resorting you get a new sample

--
Regards
Frank Kabel
Frankfurt, Germany


topkick wrote:
I have a column of employee id's that have alpha numeric characters I
need to pull a random sampling for a drug test how do I do it? I
tryed rand() and Randbetween and no luck making that work.



  #7   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
try:
=ROUND(rand()*(4-0)+1,2)

--
Regards
Frank Kabel
Frankfurt, Germany

"Shannon W." schrieb im
Newsbeitrag ...
Hi, sorry to question you on someone else's question, but it's

relevant. I
tried your method for rand and I some amount of success. I get the

sheet to
put out a random number (0 or 1). I also was able to assign this

random
function to a macro button so I could just click the button.

Finally, I
learned how to get a number other than 0 or 1. I then tried to use

this in
conjunction with the vlookup formula. The problem I encountered with

this,
is vlookup see the random number generated, however that random

number is not
exact. Example, I have the following "test" sheet:

1 Red
2 Blue
3 Green
4 Orange

Now, I have it set to =rand()*(4-0)+1, which will give me a random

number,
1-4. When I generate a number, let's say 3, it gives a random number

between
3.0000-3.9999 (just for the number 3 of course, it will generate

1.000-1.999,
etc.) I tryed to find something in the format cell, but none of the

choices
in the "Number" tab works. Any help?

"Frank Kabel" wrote:

Hi
in B1 put
=RAND()
copy this down for all rows
Now sort with column B and pick from column A the number of

required
IDs.
With resorting you get a new sample

--
Regards
Frank Kabel
Frankfurt, Germany


topkick wrote:
I have a column of employee id's that have alpha numeric

characters I
need to pull a random sampling for a drug test how do I do it? I
tryed rand() and Randbetween and no luck making that work.




  #8   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Did you put RandInt in a regular code module?

If you're unfamiliar with UDF's see David McRitchie's "Getting Started
with Macros and User Defined Functions":

http://www.mvps.org/dmcritchie/excel/getstarted.htm


In article ,
"topkick" wrote:

I tried the INDex and get a #name? error

  #9   Report Post  
Tushar Mehta
 
Posts: n/a
Default

Close but wrong function. Using ROUND() destroys the uniform nature of
the distribution. Use INT().

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Hi
try:
=ROUND(rand()*(4-0)+1,2)

--
Regards
Frank Kabel
Frankfurt, Germany

"Shannon W." schrieb im
Newsbeitrag ...
Hi, sorry to question you on someone else's question, but it's

relevant. I
tried your method for rand and I some amount of success. I get the

sheet to
put out a random number (0 or 1). I also was able to assign this

random
function to a macro button so I could just click the button.

Finally, I
learned how to get a number other than 0 or 1. I then tried to use

this in
conjunction with the vlookup formula. The problem I encountered with

this,
is vlookup see the random number generated, however that random

number is not
exact. Example, I have the following "test" sheet:

1 Red
2 Blue
3 Green
4 Orange

Now, I have it set to =rand()*(4-0)+1, which will give me a random

number,
1-4. When I generate a number, let's say 3, it gives a random number

between
3.0000-3.9999 (just for the number 3 of course, it will generate

1.000-1.999,
etc.) I tryed to find something in the format cell, but none of the

choices
in the "Number" tab works. Any help?

"Frank Kabel" wrote:

Hi
in B1 put
=RAND()
copy this down for all rows
Now sort with column B and pick from column A the number of

required
IDs.
With resorting you get a new sample

--
Regards
Frank Kabel
Frankfurt, Germany


topkick wrote:
I have a column of employee id's that have alpha numeric

characters I
need to pull a random sampling for a drug test how do I do it? I
tryed rand() and Randbetween and no luck making that work.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
what formula do i put for column m = column k minus column l in e. jenniss Excel Discussion (Misc queries) 5 January 6th 05 08:18 PM
Putting text in a column based on variable text from another colum Jacky D. Excel Discussion (Misc queries) 1 December 16th 04 06:09 PM
Change the width of a single column in a column chart Dave Charts and Charting in Excel 2 December 13th 04 07:25 PM
how to fit my column unmoved eventhough i scroll down? Zxing New Users to Excel 1 November 28th 04 06:28 AM
How to calculate the data in excel 2002 including only the last 9. TylerMaricich Excel Worksheet Functions 6 November 8th 04 07:27 AM


All times are GMT +1. The time now is 06:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"