Зміст курсу
Google Spreadsheets
Google Spreadsheets
2. Formatting of Cells and Ranges
Basic Editing OperationsFormatting DataWorking with FontsFormatting Text and Filling with ColorFormatting BordersMerging Cells and Text AlignmentClear Formatting and Paint Format ToolsSelecting Cells and RangesAdjusting Column and Row Size and PositionCopying and Deleting Columns and Rows Freezing and Grouping Rows and Columns
Random Number Generation
The RAND function generates a random number with decimal places in the range from 0 to 1 (exclusive). It is used for random data selection, generating random coefficients in modeling, and analysis. For example, when creating samples for statistics or simulating probabilistic processes.
Syntax and Examples
RAND()
- The function takes no arguments.
Formula | Result | Comment |
---|---|---|
RAND() | 0.07156 | The RAND() function generates a random number in the range from 0 to 1. |
RAND() * 9 + 1 | 1.94145 | This expression scales the random number so that it is in the range from 1 to 10. Multiplying by 9 increases the range, and adding 1 shifts it. |
Generating Random Numbers in a Range
The RANDBETWEEN function generates a random integer within the specified range, including the boundaries. It is used for generating random dates, numerical identifiers, or creating test data. It can also be used for selecting random contest participants, random questions in surveys, and more.
Syntax and Examples
RANDBETWEEN(low, high)
- low - The lower boundary of the random range;
- high - The upper boundary of the random range.
Formula | Result | Comment |
---|---|---|
RANDBETWEEN(1, 100) | 77 | This function returns a random integer in the range from 1 to 100. In this case, the result is 77. |
RANDBETWEEN(-1, 1.5) | 1 | Here, the function generates a random integer in the range from -1 to 1.5. Since the result must be an integer, 1 is returned. |
RANDBETWEEN(DATE(2020, 1, 1), DATE(2025, 12, 31)) | 3/5/2021 | This function returns a random date in the range from January 1, 2020, to December 31, 2025. The generated date is March 5, 2021. |
INDEX({"Red", "Green", "Blue", "Yellow", "Black"}, RANDBETWEEN(1, 5)) | Red | This formula selects a random color from the list: "Red", "Green", "Blue", "Yellow", "Black". The randomly generated value points to "Red". |
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 6. Розділ 7