Skip to main content

How to quickly generate random time in Excel?

In Excel, in a common situation, most of us may need to insert random numbers, date or text strings as our desired. But sometimes, have you ever tried to insert times randomly in a range of cells? Actually, we can apply some formulas to insert random time into the worksheet.

Generate random time in Excel with formulas

Generate random time in Excel with a handy feature


Generate random time in Excel with formulas

The following formulas can help you to generate random time in a range of cells, please do as these:

Generate random time in Excel

Please enter the below formula into a blank cell, and then drag the fill handle down to the cells you want to get the times, see screenshot:

=TEXT(RAND(),"HH:MM:SS")


Generate random time between two times in Excel

If you want to generate random time between two given times, such as generate time from 11 o’clock to 15 o’clock, you can use below formula.

Type the following formula into a blank cell, and drag the fill handle over to the range that you want to insert the time.

=TEXT(RAND()*(15-11)/24+11/24,"HH:MM:SS")

And you will get the random time which between 11 o’clock and 15 o’clock. See screenshot:

Note: In the above formula, the number 15 is the end time, and 11 stand for the start time. You can change them as you need.

Generate random time at specific intervals in Excel

To generate random times at specific intervals, such as random times at a 15-minute interval.To deal with this job in Excel, you can use the RAND and FLOOR functions within the TEXT function, please do as this:

Copy or enter the following formula into a blank cell, and then drag the fill handle down to the cells that you want to get the time.

=TEXT(FLOOR(RAND(),"0:15"),"HH:MM:SS")

Note: In the above formula, the number 15 is the time interval, if you need the random times with 30- interval, just replace the 15 with 30.

Generate random date and time between two datetimes in Excel

Here is also a formula which can help you to generate random date and time in the worksheet.

Please enter or copy the below formula into a blank cell, then drag the fill handle to the cells that you want to insert the date and time.

=TEXT(RAND()*("2021-2-10 12:00:00"-"2020-10-1 9:00")+"2020-10-1 9:00:00","YYYY-MM-DD HH:MM:SS")

Note: in this formula, 2021-2-10 12:00:00 stands for the end date and time, and 2020-10-1 9:00:00 is the start date and time, you can modify them to your need.

Generate random time in Excel with a handy feature

If you are tired of the formulas, here, I can talk about an easy way to solve it. With Kutools for Excel’s Insert Random Data utility, you can quickly insert random numbers, date, time, and other text strings.

Note:To apply this Insert Random Data, firstly, you should download the Kutools for Excel, and then apply the feature quickly and easily.

After installing Kutools for Excel, please do as this:

1. Select a blank range of cells that you want to insert random time.

2. Click Kutools > Insert > Insert Random Data, see screenshot:

3. In the Insert Random Data dialog box, click Time tab, and then enter the start time into the From box, and type the end time into the To box, see screenshot:

Tips: To insert some random distinct time, please check Unique values option.

4. Then click Ok or Apply button, the random time has been inserted into the cells. See screenshot:

Download and free trial Kutools for Excel Now !


More relative articles:

  • Generate Random Date Between Two Dates
  • When you use an Excel file, sometimes you want to generate random date for some purpose, of course, you can enter the date manually one by one, but if you need to insert multiple dates, this method will be time-consuming and boring. How to quickly generate random date on earth in Excel?
  • Check If Time Is Between Two Times
  • In Excel, how could you check if a specific time is between two given times? To check them one by one will waste lots of time, here, I will introduce some simple formulas to solve this job.
  • Convert Time Format From 12 Hour To 24 Hour And Vice Versa
  • When you work on Excel in your daily work, you may use different time format under different conditions, such as 12 hour format and 24 hour format as following screenshot shown. But, how could you convert time format from 12 hour to 24 hour and vice versa in Excel?
  • Calculate Hours Between Times After Midnight
  • Supposing you have a time table to record your work time, the time in Column A is the start time of today and time in Column B is the end time of the following day. Normally, if you calculate the time difference between the two times by directly minus "=B2-A2", it will not display the correct result as left screenshot shown. How could you calculate the hours between two times after midnight in Excel correctly?

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (5)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Thanks a lot. It helps immediately!
Rated 5 out of 5
This comment was minimized by the moderator on the site
i want to chose randome hours betwee 2 times for example random time betwee 12 and 5 plus betweene 2 dates or at least without the weekends
on this fourmola
=TEXT(RAND()*("2021-2-10 12:00:00"-"2020-10-1 9:00")+"2020-10-1 9:00:00","YYYY-MM-DD HH:MM:SS")
This comment was minimized by the moderator on the site
Ini sangat membantu saya. Tapi bagaimana caranya untuk menghapus Detik?
This comment was minimized by the moderator on the site
Hello, Wildan

If you want to insert the times without second, you just need to remove the "ss" from the formulas, such as:
=TEXT(RAND(),"HH:MM")
=TEXT(FLOOR(RAND(),"0:15"),"HH:MM")
=TEXT(RAND()*(15-11)/24+11/24,"HH:MM")
=TEXT(RAND()*("2021-2-10 12:00:00"-"2020-10-1 9:00")+"2020-10-1 9:00:00","YYYY-MM-DD HH:MM")

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Thanks for the post, i really needed random hour, and this helped me a lot!!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations