Returns a uniformly distributed random number greater than or equal to 0 and less than 1. A new value will be returned each time the worksheet is calculated.
Syntax
RAND()
When making tables , sometimes random sampling is needed for fairness, in this case the random function RAND can be used;
[RAND function is a parameterless function that can automatically Returns random data greater than or equal to 0 and less than 1, and the data generated is different every time]
Next, we will explain how to use this function in WPS2019:
■ First, generate random data between 0 and 1 (0≤random number<1), enter " =RAND()";
■ Second, if you think the value between 0 and 1 is too small.
You can use the formula "=RAND()*100" in (C3), add *100 to expand by 100Twice;
■ Third, if you want to specify a range for this random function, then we should use "=RAND()*(B-A)+A" .
For example, if I now specify a range that randomlygenerates a value between 10 and 50, then it should Enter "=RAND()*40+10" in (C4);
■ Fourth, if there are too many decimal places, we can also specify to retain the decimal places.
For example, if I only want the random number to retain two decimal places, enter it in (C5) "=ROUND(RAND(),2)"
Or you can also define the number of decimal places through "Number" in "Format Cells";
■ Fifth, generate a random integer between A and B. For example, I hope to generate an integer between 10 and 50. At this time It is necessary to use method 3 and method 4 comprehensively;
AlsoYou can also directly use the INT automatic rounding function, enter " =INT(RAND()*40+10)”.
■ Click the shortcut key F9 to quickly update data.
评论列表(196条)
测试