Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Generate Random Number in Excel

Mar 17, 2010 2:34AM PDT

I want to generate 8 different random numbers between 1 & 99 in Excel 2007.
I put formula =RANDBETWEEN(1,99) in cell A1 and then using the Fill Handle, Drag down fill A1:A8.
Each time I want a new set of numbers I then just press F9 on the keyboard. This obviously produces 8 numbers between 1 & 99, but often the same number is repeated in the selection. How do I tell Excel, as simply as possible, that I do not want to repeat a number in the selection?
Thanks Mike7P

Discussion is locked

- Collapse -
Just some thoughts.
Mar 17, 2010 7:29AM PDT
http://support.microsoft.com/kb/828795 reveals that RAND failed in prior versions of Excel but since each number is indeed random, a repeat is expected. Long discussions about what random is and isn't may happen.

If you want 8 unique numbers, you may have to code it up to do so.
Bob
- Collapse -
Thanks Bob, I've not
Mar 17, 2010 8:24AM PDT

mastered coding yet so will need to get some practice in soon.Anybody out there got any hints where to start.
Thanks
Mike7P

- Collapse -
See if others have thought about it (yes.)
Mar 17, 2010 8:28AM PDT
- Collapse -
Thanks again Bob...
Mar 17, 2010 9:19AM PDT