View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] terryspencer2003@yahoo.ca is offline
external usenet poster
 
Posts: 32
Default Upper and Lower Bounds and Rnd

I have been using the following formula to generate a random number
between 1 and 42. I have made my UpperBounds = 42 and my LowerBounds
= 1. I ran 1,000 iterations and in several instances, the random
number generated equaled 43. How is this? Is there an error in my
logic?

RandomNumber = Int((UpperBounds - LowerBounds) + 1)* Rnd + LowerBounds

TS