请教 excel 中 rnd函数和 rand函数的区别是什么?用哪个函数产生的随机数的均匀性,随机性更好?
版主:Rand()是excel的函数,RND()仅适用于VBA.
Rand FunctionIn Excel, the Rand function returns a random number that is greater than or equal to 0 and less than 1. The Rand function returns a new random number each time your spreadsheet recalculates.
The syntax for the Rand function is: Rand( )
Note:
To create a random number between two numbers, you can use the following formula:
=Rand()*(b-a)+aWhere a is the smallest number and b is the largest number that you want to generate a random number for. Please note, that this formula will never generate a number at the highest end of the range.
=Rand()*(25-10)+10The formula above would generate a random number between 10 and 24.9999999.
Applies To: Excel 2007, Excel 2003, Excel XP, Excel 2000
-------------------------------
Rnd Function (VBA only)In Excel, the Rnd function allows you to generate a random number (integer value). You can specify the random number to be a value between 2 user-specified numbers.
The syntax for the Rnd function is:
Int ((upperbound - lowerbound + 1) * Rnd + lowerbound)upperbound is the highest value that the random number can be.
lowerbound is the lowest value that the random number can be.
Applies To:
- Excel 2007, Excel 2003, Excel XP, Excel 2000
可参考:
http://slamkk.blog.163.com/blog/static/256110920107393120550/