View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
GSpline GSpline is offline
external usenet poster
 
Posts: 20
Default Trouble with RANDBETWEEN

Thanks

"JE McGimpsey" wrote:

From VBA Help ("Rnd Function"):

To produce random integers in a given range, use this formula:

Int((upperbound - lowerbound + 1) * Rnd + lowerbound)

Here, upperbound is the highest number in the range, and lowerbound is the
lowest number in the range.



In article ,
"GSpline" wrote:

Could we say that if we wanted to write out the rule for performing this
particular type of calculation, that if we wanted to generate a random number
(MyValue) between two other numbers (x, y) and yx :
MyValue = Int( ( ( (y-x)+1)*RND() ) + (x-1) )

This should work for most positive random numbers that we wish to find
random numbers between, right?