Thread: RANDBETWEEN()
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default RANDBETWEEN()

using the formula =RANDBETWEEN(1,15) to
generate random numbers in cells A2 through A6.


One way...

This formula references cell A1. A1 must not contain a number from 1 to 15.

Create this named formula:
Goto the menu InsertNameDefine
Name: Nums
Refers to: ={1;2;3;4;5;6;7;8;9;10;11;12;13;14;15}
OK

Enter this array formula** in A2 and copy down to A6:

=SMALL(IF(ISNA(MATCH(Nums,$A$1:A1,0)),Nums),INT(RA ND()*(15-ROW()+ROW(A$2)))+1)

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Paul" wrote in message
...
I'm using the formula =RANDBETWEEN(1,15)
to generate random numbers in cells A2 through A6.
I don't want any of those random numbers to be repeated.
Any suggestions on how to do this?
Thanks for your help.