Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to use random number function
How to use random number function
Random function is a function that generates numbers, and it is a very important function in EXCEL. There are also random functions such as rand (), RAND () rand s RAND () in C language.

(1) It is relatively simple to generate random numbers, =rand () can generate random numbers between 0 and 0-rand _ max; (#define RAND_MAX 0x7fffu)

(2) If it is an integer, use =int(rand()% 10) to represent an integer from 0 to 9, and so on;

(3) If you want to generate a random real number between a and b, use =rand()%(b-a+ 1)+a to generate an integer with a fixed number of digits, and so on;

Note: If you want to generate a random number with the function rand () and it doesn't change with the cell calculation, you can enter "=rand ()" in the edit field, keep the editing status, and then press F9 to permanently change the formula to a random number. However, this can only be changed permanently one by one. If there are many numbers, you can also select all the numbers and paste them in another suitable location. The paste method is to right-click and select Paste Special, and then select the numerical value, so that you can copy the numerical value generated by the previously copied random number formula (not the formula).