How to Generate Random Numbers in Google Sheets with RAND and RANDBETWEEN Functions

Have you ever needed to generate random numbers in Google Sheets? Well, you’re in luck because there are two powerful functions that can help you with that: RAND and RANDBETWEEN. In this article, we’ll explore how to use these functions and create random numbers effortlessly.

Generating Random Numbers with the RAND Function

The RAND function is simple yet effective. Just by typing =RAND() in any cell, you can generate a random number between 0 (inclusive) and 1 (exclusive). The best part is, every time you insert the RAND formula, you’ll get a new random number.

Generated random number with RAND function

Keep in mind that the RAND function is volatile, meaning the random number it generates will change whenever you make changes to your spreadsheet. It’s similar to the NOW() function, but you have control over the frequency of this change.

Creating Random Integers with the RANDBETWEEN Function

If you need to generate random integers within a specific range, the RANDBETWEEN function is your go-to solution. Unlike RAND, RANDBETWEEN requires arguments to specify the low and high ends of the range.

Here’s the syntax: RANDBETWEEN(low, high)

For example, if you want a random number between 1 and 10 (both inclusive), use the formula =RANDBETWEEN(1, 10). The best part is, you can customize the range however you like.

Generated random number with RANDBETWEEN function

Using the Flexible RAND Function

Although RANDBETWEEN is great for generating random integers, the RAND function offers more flexibility. You can use it in combination with other functions to achieve your desired results.

For instance, if you want a unique integer between 0 and 100 (excluding 100), use =TRUNC(RAND()*100). Similarly, for a range of 0 to 10 (excluding 10), use =TRUNC(RAND()*10).

But what if you want more control over the range? Don’t worry, you can still achieve that with the RAND function. By subtracting your desired lower value from the output, you can set both the lowest and highest arguments indirectly.

For example, to generate a random number between 10 and 100 (inclusive for 10, exclusive for 100), use =TRUNC(RAND()*(100-10)+10). Feel free to experiment with different ranges and values to suit your needs.

And there you have it! With the RAND and RANDBETWEEN functions, generating random numbers in Google Sheets is a breeze. Whether you need a single random number or a range of random integers, these functions have got you covered.

For more useful tips and tricks on Google Sheets, visit Crawlan.com. Happy spreadsheeting!

(Original article adapted and rewritten by Crawlan.com)

Related posts