Random Numbers Not Equal to

  • Thread starter Thread starter Joe Blow
  • Start date Start date
J

Joe Blow

Hi,

I have 8 cells that I want to contain a unique whole number from 1 to
8. I don't want any of the 8 numbers to repeat.

Any ideas?

Joe
 
One very limited way:

B1: 12345678
B2: =SUBSTITUTE(B1,A1,"")
A1: =MID(B1,RAND()*(LEN(B1)-1)+1,1)*1

Copy the the formula in A1 down to A8, and the one in B2
down to B8.

HTH
Jason
Atlanta, GA
 
Cool, though this always results in 8 being the last selected. It seems to
work OK with this in A1;

=MID(B1,ROUNDUP(RAND()*(LEN(B1)),0),1)*1
 
You're right. Should be:

=MID(B1,RAND()*(LEN(B1))+1,1)*1

I rarely use RAND - just RANDBETWEEN.

Jason
 
Back
Top