Reputation: 173
I was doing a problem and using the function rnd() but the random values <0.001359 were making other values not acceptable.
How to generate random numbers beginning at 0.001359 until 1?
Upvotes: 0
Views: 3873
Reputation: 6713
This will give you a random number greater than or equal to 0.001359 and less than 1.
0.001359 + Rnd() * 0.998641
Upvotes: 3
Reputation: 429
Try this formula (Excel 2013):
=(RANDBETWEEN(1359,1000000)) / 1000000
Since it only returns whole numbers, just slide the decimal as needed and then divide the result to get back to you decimal.
To do that in VBA, you can use this:
randomnumber = WorksheetFunction.RandBetween(1359, 1000000) / 1000000
Upvotes: 0