Question : Generate unique random numbers

Hi,

I need something that will generate a column full of random numbers between say 1 and 50, which are unique, the number of rows to include needs to be dynamic and would prefer a formula as need to avoid vba.

Cheers

Answer : Generate unique random numbers

1) List the numbers 1 through 50 in A1:A50
2) Put the following formula in cells B1:B50
=RAND()
3) To pull a set of umpteen unique random numbers, use the following formula in cell C1 then copy it down:
=INDEX($A$1:$A$50,MATCH(SMALL($B$1:$B$50,ROWS($C$1:$C1)),$B$1:$B$50,0))

Each time you hit F9, you get a different selection of random numbers

For grins, the sample workbook highlights any duplicates.

Brad
 
Sample workbook showing method
 
Random Solutions  
 
programming4us programming4us