MrExcel Publishing
Your One Stop for Excel Tips & Solutions

picking a random number between two numbers


Posted by steve on December 09, 2001 10:54 AM

anyone know the fomula for picking a random number between 5 and 10?


Posted by Aladin Akyurek on December 09, 2001 11:04 AM

=RANDBETWEEN(5,10)

perhaps?

Aladin

Posted by sdimaggio on December 09, 2001 11:44 AM

Thanks but, when i type =RANDBETWEEN(5,10)
into a cell i get #NAME? in the cell. Did I do something wrong

Posted by Aladin Akyurek on December 09, 2001 11:53 AM

No. It means that the function is not available on your system. You can get by checking Analysis Toolpak via Tools|Add-Ins.

Aladin

========

Posted by sdimaggio on December 09, 2001 11:55 AM

Thanks!

Posted by Duncan on December 11, 2001 4:59 AM

Alternative Method

Alternatively you can remap the random number between 0 and 1 to 5 to 10 by multiplying by 5 and adding 5.
So =rand()*5+5
Worth remembering such tricks