Search

Filling cells with random numbers in libreoffice

While working with data in a spread sheet, we might have the need of filling up certain cells with random numbers with in a given range. We might enter these numbers ourselves if only a few are required, but if a large number of random numbers are needed then it will be tiresome and time consuming to do ti manually.

Libreoffice provides a shortcut to fill the cells with random numbers of what ever range we need. To fill the cells with random numbers, follow the procedure below.

Open libreoffice calculator/spreadsheet and select the range of cells in which random numbers have to be filled.

 photo random_select_range.png

Now click on Edit->fill->random numbers

 photo random_edit_menu.png

It will prompt a menu as shown below.

 photo random_number_gen.png

In the menu

Cell range: Is the range of cells that has been selected for filling with random numbers
Distribution: In case we are specific about the distribution of random numbers we can select one of the distributions. If we want only integers we can select Uniform integers
Seed: All random number generators us a seed value to generate random numbers, if we are specific about certain seed we can specify the same by selecting the check box and entering the seed value. else we can leave the default value.
Maximum and minimum: The range between which we want the random numbers to lie.

Afte entering the values as we need click on ok, and the range selected will be filled with the random numbers of hte given range.

 photo random_decimal_truncated.png

In case we want the random number to be in decimal, by default the random number generator will generate numbers with 8 decimal places.

 photo random_number_generated.png

If we do not need such high precision, we can truncate the value to one or two decimal places by right clicking on the cells and selecting format cells.

 photo random_format_cells.png

Select the numbers tab

 photo random_decimal.png

Select category as number and then choose the number of decimal places required and click on ok.

 photo random_2_decimal.png


No comments:

Post a Comment