Generate Random time based on given time.

Kim Wilkins

New Member
Joined
Sep 18, 2014
Messages
1
How can I generate a random time based on a given time thats within plus or minus a set amount of time, say 30 minutes before or after. For example, I have a cell which contains the time 15:30:00. I want to generate a random time that is based on that cell and can be anywhere between 15:00:00 and 16:00:00. Is this possible in excel? Thanks for the help.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,849
Office Version
  1. 365
Platform
  1. Windows
How about this with your time in A1:

=RANDBETWEEN(((A1-"00:30:00")*100),((A1+"00:30:00")*100))/100
 
Upvote 0

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,849
Office Version
  1. 365
Platform
  1. Windows
Or even this without the bonus brackets!

=RANDBETWEEN((A1-"00:30:00")*100,(A1+"00:30:00")*100)/100
 
Upvote 0

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,836
Office Version
  1. 2010
Platform
  1. Windows
Or

=A1+(RAND()-0.5)/24

Of, if you want whole minutes,

=A1+RANDBETWEEN(-30,30)/1440
 
Last edited:
Upvote 0

Forum statistics

Threads
1,190,745
Messages
5,982,713
Members
439,791
Latest member
NwaTech_

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top