Google spreadsheets: Random numbers and decimals
- May 11th, 2009
- Posted in Google docs . Tutorial
- Write comment
Google spreadsheets has 2 build-in random-number functions. Rand() and Randbetween().
Most of the time, I use randbetween(), because it offers a quick and easy way to insert some random numbers. However, this function only insert rounded numbers.
If you want to insert random numbers with decimals, you can use Rand(). I will explain both functions here.
Randbetween()
Randbetween() could not be any easier:
Randbetween(Minimum, Maximum).
So, if you want a random number between 10 and 100, you can simply use
=Randbetween(10, 100)
and there you have it.

Rand()
Rand is a more complex function. Rand creates random numbers lower then 1 and larger then 0:

At first, you might think “what am I going to use these for?”. But with a little addition, you can use rand() to create random numbers with decimals.
Rand, by itself, does not require any arguments. You can just type
=Rand()
and you’ve got your random number.
To get some random currency, we need to add ’round’. Round rounds a number to the amount of decimals you specify.
Now, we want to create a random currency value between 0 and 25:
=Round( ( Rand()* 25), 2)

No comments yet.