I have a formula to generate a random number between 0 and 10.
.![]()
=Round(RAND() * ((10 - 1) + 1), 2)
I only need a number between 3 and 10 and can't figure out how to modify the formula for this. Any help to modify code is appreciated. Thanks.
I have a formula to generate a random number between 0 and 10.
.![]()
=Round(RAND() * ((10 - 1) + 1), 2)
I only need a number between 3 and 10 and can't figure out how to modify the formula for this. Any help to modify code is appreciated. Thanks.
Last edited by maacmaac; 05-05-2009 at 11:07 AM.
Hi,
Use RANDBETWEEN
=RANDBETWEEN(3,10)
oldchippy
-------------
![]()
![]()
Blessed are those who can give without remembering and take without forgetting
If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.
Click here >>> Top Excel links for beginners to Experts
Forum Rules >>>Please don't forget to read these
=INT(8*RAND()) + 3
Or =RANDBETWEEN(3,10) with the Analysis Toolpak.
Entia non sunt multiplicanda sine necessitate
=round((rand() *7 + 3),2)
Regards
Special-K
Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.
Don't think so, Special-K.
Don't think so shg=RANDBETWEEN(3,10)
Pardon, OC?
Sorry mate, I was sure I read that as
=RANDBETWEEN(3,1)
Need to change eyes![]()
Didn't expect so many solutions but much appreciated. Good to know for future reference.
I ended up using =INT(8*RAND()) + 3 and/or =round((rand() *7 + 3),2) . Could not use the Randbetween function as my company is still using Office 2000.
Thanks for comments.
If you use ROUND, the end-point numbers will occur with half the likelihood of the interior numbers.
To see a quick example, copy =ROUND(3 * RAND(), 0) down 600 rows. On average, you'll see 100 0's, 200 1's, 200 2's, and 100 3's.
Good point. Thanks for the tip...another one I can file away for future reference.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks