Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Matt D Francis
 
Posts: n/a
Default Unique RANDOM NUMBERS within specified range

Hi,

I have looked at the Random Number Generator Add-in and the =RAND function
but can't get either to do what I want (although I'm sure they can)

I have a range of cells in a single column (A2:A3667), and I want a list of
random numbers to fill that range using the values 1:3666, using each value
once and once only. Effectively randomising the row numbers.

How can I do this?

Cheers,

Matt

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Unique RANDOM NUMBERS within specified range

Matt,

In A2, enter

=RAND()

In B2, enter

=RANK(A2,$A$2:$A$3667)

then copy A2:B2 down to row 3667.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Matt D Francis" wrote in message
...
Hi,

I have looked at the Random Number Generator Add-in and the =RAND function
but can't get either to do what I want (although I'm sure they can)

I have a range of cells in a single column (A2:A3667), and I want a list

of
random numbers to fill that range using the values 1:3666, using each

value
once and once only. Effectively randomising the row numbers.

How can I do this?

Cheers,

Matt



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Matt D Francis
 
Posts: n/a
Default Unique RANDOM NUMBERS within specified range

Hi,

Well that worked - wasn't quite the way I was expecting to be able to do it,
but thanks! Can this guarantee that the numbers in column A will be unique?

Also, don't know if this is normal but the random numbers I generate in Col
A are all decimals, why's that?

"Bob Phillips" wrote:

Matt,

In A2, enter

=RAND()

In B2, enter

=RANK(A2,$A$2:$A$3667)

then copy A2:B2 down to row 3667.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Matt D Francis" wrote in message
...
Hi,

I have looked at the Random Number Generator Add-in and the =RAND function
but can't get either to do what I want (although I'm sure they can)

I have a range of cells in a single column (A2:A3667), and I want a list

of
random numbers to fill that range using the values 1:3666, using each

value
once and once only. Effectively randomising the row numbers.

How can I do this?

Cheers,

Matt




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey
 
Posts: n/a
Default Unique RANDOM NUMBERS within specified range

Because RAND() returns values from [0...1).

Another way, without the helper column:

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


In article ,
"Matt D Francis" wrote:

Also, don't know if this is normal but the random numbers I generate in Col
A are all decimals, why's that?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Unique RANDOM NUMBERS within specified range

I cannot guarantee that the numbers in A will be unique, but in all the
times I have used it I have never seen a duplicate.

If you want to be sure, use

A2: =RAND()
B2: =RANK(A2,$A$2:$A$3667)+ROW()/10^7
C2: =RANK(B2,$B$2:$B$3667,1)

and copy down

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Matt D Francis" wrote in message
...
Hi,

Well that worked - wasn't quite the way I was expecting to be able to do

it,
but thanks! Can this guarantee that the numbers in column A will be

unique?

Also, don't know if this is normal but the random numbers I generate in

Col
A are all decimals, why's that?

"Bob Phillips" wrote:

Matt,

In A2, enter

=RAND()

In B2, enter

=RANK(A2,$A$2:$A$3667)

then copy A2:B2 down to row 3667.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Matt D Francis" wrote in

message
...
Hi,

I have looked at the Random Number Generator Add-in and the =RAND

function
but can't get either to do what I want (although I'm sure they can)

I have a range of cells in a single column (A2:A3667), and I want a

list
of
random numbers to fill that range using the values 1:3666, using each

value
once and once only. Effectively randomising the row numbers.

How can I do this?

Cheers,

Matt








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Unique RANDOM NUMBERS within specified range



"JE McGimpsey" wrote:

Because RAND() returns values from [0...1).

Another way, without the helper column:

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


In article ,
"Matt D Francis" wrote:

Also, don't know if this is normal but the random numbers I generate in Col
A are all decimals, why's that?


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
Counting Unique Part Numbers In A Range BigH Excel Worksheet Functions 2 December 9th 05 07:09 PM
Count comma separated numbers, numbers in a range with dash, not t Mahendra Excel Discussion (Misc queries) 0 August 8th 05 05:56 PM
random numbers from a data of numbers? MaryEng Excel Worksheet Functions 6 May 31st 05 12:09 PM
Random Assignment of Numbers itse Excel Worksheet Functions 2 March 17th 05 02:14 AM
Help on Random Numbers sara Excel Discussion (Misc queries) 7 February 17th 05 02:03 AM


All times are GMT +1. The time now is 02:17 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"