Random Numbers Not Equal to

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
 
J

Jason Morin

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
 
D

Dave R.

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
 
J

Jason Morin

You're right. Should be:

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

I rarely use RAND - just RANDBETWEEN.

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top