Creating Random Numbers in Excel

by | Oct 17, 2014

Have you ever needed to generate random dates in an Excel spreadsheet? You may not need it often, but when you do, this tip is quite handy. This is the kind of training we cover in our Advanced Excel class, and help you with in your office!

To create random numbers, use this formula:
=RANDBETWEEN(DATE(2003,1,1),DATE(2014,9,30))

The first argument, DATE(2003,1,1), is the low end of the range (earliest), and DATE(2014,9,30) was the high end of the range (most recent).

This creates a random date between 1/1/2003 and 9/30/14. Then, format the number so it appears as a “Date” to turn it into an understandable format.

Last, drag the AutoFill Handle (the little dot in the bottom corner of the cell) down to the bottom of my column to duplicate the formula.

If you want just a random number between two values, you would do the same thing, but replace the DATE(2003,1,1) with the low and high numbers.

Creating Random Numbers in Excel

Udemy Course Learn Excel in 3 Hours Flat

 

Need to learn Excel quickly? Check out Alicia’s online course, Learn Excel in 3 Hours Flat. For only $59 you get lifetime access to the course.

About Alicia Katz Pollock

With a Masters in Teaching from Tufts University, a QuickBooks®️ Online Advanced Certification and more than 30 years’ experience in the tech industry, Alicia is passionate about finding creative, practical solutions to complex and everyday tech problems. She also loves a good laugh!

Comments

2 Comments

  1. van

    Hi my name is Van i would like to learn formula random numbers for lotteries, example from 1 to 40, just choice number myself, example numbers are 8-25-9-13-33-22-18-4-20-38-15-36-6-11-1…ete….play 7 numbers for 10 games then click random button, then come the results, at last 1 line will matching all number i choice? anyone can be training onside or can sale me the formats?

    hope someone can help.
    thanks

    Reply
    • Alicia Katz Pollock

      Hi Van,

      It’s not hard to choose 7 random numbers between 1 & 40 and string them together…but are you asking that one of them matches the one you’ve chosen yourself? You would have to include code to physically match the numbers with one of the answers to create a winner.

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *