Several tips for creating multiple random numbers easily and quickly

user:visitors Date:2022-03-18 17:43:194600

Regarding the tips for creating random numbers, this article briefly shares several methods for generating random numbers quickly and easily using common office software or browsers.

1. Use excel sheet to creating random numbers

First open excel and select a cell

Then enter =RAND() in the cell where the random number needs to be created, and after pressing the Enter key, you can create a random number from 0 to 1

The above can only generate random numbers between numbers 0 or 1. In order to generate random numbers in a larger range, we also need to modify the formula as:

=1+RAND()*(30-1)

After pressing Enter, a random number between 1 and 30 can be generated. Here, RAND() is the basic number, and then = start range + RAND() * (end range - start range) to create in the table Random numbers in the specified range.

Select the cell and drag the small box in the lower right corner downward to generate multiple random numbers. Of course, the random numbers include decimals. If only integers are needed, we can modify them as:

=RANDBETWEEN(1,30)

or

=ROUND(1+RAND()*(30-1),0)

This method can directly generate random integers from 1 to 30 directly.

2. Use word document to generate random numbers

Generating random numbers in a word document is similar to excel. It is equivalent to calling excel to create random numbers. First, open or create a new word file.

Then find the "Insert" tab in the toolbar and click the "Object" button.

Continue in Object Type, select "Microsoft Excel Binary Worksheet"

After confirmation, enter the formula in method 1 in the cell of the inserted Excel object frame to create random words in word.

3, txt notepad implementation

Create a new blank txt text in the computer, and then copy the following code into it.

<script type="text/javascript">

function sjsz(minsz,maxsz,num){

var newsjsz="";

for (var i=0;i<num;i++){

newsjsz+=parseInt(Math.random()*(maxsz-minsz+1)+minsz,10)+", ";

}

return newsjsz;

}

var suijishu=sjsz(1,30,10);

alert(suijishu);

</script>

Among them, var suijishu=sjsz(parameter 1, parameter 2, parameter 3); can modify parameter 1 to set the minimum value, parameter 2 to set the maximum value, and parameter 3 to specify the number of random numbers to be created.

Then select File - Save As, select the file type as All Types, change the file name to suiji.html, and then save.

Double-click or drag this file into the browser to open and refresh the page directly to generate a random integer between 1 and 30.

2. Use the random number generator on this site to create random numbers

First, in the life tools column of this site, find the "random number generator"

Then set the number of random numbers generated, and whether there are repeated random numbers

Then set the start and end value range of random numbers, and select the "Create" button to quickly create multiple random numbers in the browser.

The above are some simple tips to directly create one or more random numbers using software commonly used in life or not applicable software.

Popular articles
latest article