Hi, I am trying to run a random time generator and am uncertain
what functions I need to include. The time is from 8:00 AM to 4:PM
and hope someone can give me a clue.
Thanks
opt
Hi, I am trying to run a random time generator and am uncertain
what functions I need to include. The time is from 8:00 AM to 4:PM
and hope someone can give me a clue.
Thanks
opt
Last edited by VBA Noob; 11-17-2008 at 03:36 AM.
Hi Optionistic,
You could try a formula such as this:
=RANDBETWEEN(333,666)/1000
Format the cell as Time (e.g. hh:mm:ss AM/PM).
8:00AM is stored as .333 in Excel, and 4:00PM is .667. Since RANDBETWEEN only works on integers, this method is somewhat of a work-around.
Hope that helps!
This formula will give you a random time between 8 AM and 4 PM
=(RAND()+1)/3
If you want a generic version....
=RAND()*(end-start)+start
and you might want to put some rounding in there to round to the nearest minute like
=ROUND((RAND()+1)/3*1440,0)/1440
Ok so a second part to this is how do I exclude from 12:00 - 12:30pm?
I'm doing a time study at work and need "random" times to do the recording. our lunch is between 12 and 12:30 and obviously no one is working.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks