The RANDBETWEEN function is a simple function you might use to generate random numbers.

For example, I can enter RANDBETWEEN with a bottom value of 1 and a top value of 100.

When I press Enter, I get a random value between those two values.

To get more natural prices I can modify the formula to subtract 5 cents.

I’m using the shortcut Control + Enter here to enter all formulas at once.

you could also use RANDBETWEEN to generate random dates.

For example, I can use theDATE functioninside RANDBETWEEN to generate random dates between January 1st and June 30.

I could also put these dates on the worksheet and then point to those cells inside RANDBETWEEN.

I need to make thesereferences absolutewith F4 to prevent changes.

This makes it easier to change the dates being used by RANDBETWEEN.

I can even combine this approach with theWORKDAY functionto generate random working days.

Finally, you might wonder how it’s possible for you to generate random text values?

A simple way to do this is to combine RANDBETWEEN with theCHOOSE function.

I can start off using CHOOSE with a hard coded index of 1, followed by the Group options.

When I press Enter I get Fox, since Fox is the first item in the list.

And if I change index to 2, I get Bear.

Now I can simply replace the hard coded index with a number generated by RANDBETWEEN.

Since we have 4 groups, the lower value is 1 and the upper value is 4.

When I double-click thefill handleto copy the formula down, all groups are assigned.

Remember that RANDBETWEEN is a volatile function.

It will recalculate whenever you change the worksheet.

after you snag random values assigned, you’ll probably want to stop this recalculation.

The easiest way to do that is to usePaste Specialtooverwrite the formulas with values.