Thread: Random number
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave B[_7_] Dave B[_7_] is offline
external usenet poster
 
Posts: 2
Default Random number

You could also try this fairly simple method:-

In A1 type =RAND()
Copy this to A2:A50

In B1 type =RANK(A1,a$1:a$50)
Copy this to B2:B6

You will be *ranking* each of the random numbers in A1 to A6 as they appear
within the group A1 to A50 and showing this ranking as an integer in B1:B6

In theory this method could yield duplicates but probably not - given the
small quantity of numbers involved i.e. 6 from 50.

HTH
Dave



"ed" wrote in message
...
How would i set up a macro to generate six random numbers
in consecutive cells between 1 and 50. There cannot be a
any duplicate numbers though?

Thanks in advance for your help.

Ed