Randbetween function in excel
The RANDBETWEEN formula generates a random number between the specified numbers. It is derived from two words, random and between. Random means selecting any random number unknown to anyone, while between means finding the number between the specified ranges. The value returned will be from the specified range only. It cannot lie outside the specified range.
It is given by:
Bottom: It represents the lower value of the specified range
Top: It represents the upper value of the specified range
It will return the integer number within the specified range of numbers in excel.
Condition: Bottom < Top or Bottom = Top
Bottom can never be greater than the top. Otherwise, excel will return an error.
Note: RANDBETWEEN() function accepts only integer values.
It will display a random number between 4 and 10. It can be any number. It is generally used to find a lucky draw number in excel among various students or names in excel. We only need to type the formula in the form of '=RANDBETWEEN(bottom, top).' We can set any range as per the requirements.
Let's consider other examples.
a. RANDBETWEEN(-10, 0)
Value returned: -6
Explanation: The function will return any number between -10 and 0, i.e., -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, and 0.
Here; the value returned is -6.
b. RANDBETWEEN(1000, 10000)
Value returned: 1141
Explanation: Here, the random number returned between the range 1000 and 10000 is 1141.
c. RANDBETWEEN(50, 200)
Value returned: 131
Explanation: Here, the random number returned between the range 50 and 200 is 131.
d. RANDBETWEEN(1, 100)
Value returned: 19
Explanation: Here, the random number returned between the range 1 and 100 is 19.
Important points about RANDBETWEEN()
Let's consider some examples.
Example 1: To find the lucky draw of students in a school with serial number 1 to 8.
Here, we will use the RANDBETWEEN() function that works as a lucky draw. The function returns a value which is not pre-known to anyone. It can be any random value between the specified ranges.
Consider the below steps:
Example 2: Here, we will generate random number of various number ranges.
Consider the below table:
To generate the random number using the RANDBETWEEN() function, consider the following steps:
Thus, the RANDBETWEEN() function on each cell will work as:
Value returned: 5
Value returned: 2
Value returned: -16
Value returned: 495
Value returned: 21216
Value returned: 4
Value returned: 1