+ Reply to Thread
Results 1 to 3 of 3

Function to randomly output date/time between to fixed date/times

  1. #1
    Registered User
    Join Date
    05-16-2018
    Location
    Aarhus, Denmark
    MS-Off Ver
    Microsoft Office 365, Version 1804
    Posts
    2

    Function to randomly output date/time between to fixed date/times

    Hi there.

    I'm trying to output a list of random date/times (yyyy-mm-dd hh:mm:ss) within a fixed interval.

    I've tried with this formula:
    =TEXT(RAND()*("2018-07-01 22:00:00"-"2018-06-04 00:00:00")+"2018-06-04 00:00:00";"yyyy-mm-dd hh:mm:ss")

    But the output is not entirely as I wish:
    E.g. yyyy-06-23 hh:47:15

    What do I need to do in order to get the 'yyyy' and 'hh' to work?

    Thanks in advance
    Last edited by 160998; 05-17-2018 at 02:49 AM. Reason: Problem solved

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Function to randomly output date/time between to fixed date/times

    Looks like your regional settings aren't set to yyyy or hh

    Check your regional settings (Locale)
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    05-16-2018
    Location
    Aarhus, Denmark
    MS-Off Ver
    Microsoft Office 365, Version 1804
    Posts
    2

    Re: Function to randomly output date/time between to fixed date/times

    Of course. Thanks, K

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Calculation between date & time MINUS date & times
    By rayted in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-08-2018, 05:14 AM
  2. [SOLVED] Textual output, based on workers' variable and fixed Start and Finishing Times
    By DrEcosse in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-29-2015, 03:41 PM
  3. Exact Date and Time compare within a range of exact date and times Lookup and Flag
    By john2001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2015, 06:01 PM
  4. [SOLVED] Time as an elapsed value, not date and time or period between two date times
    By stephenbooth_uk in forum Excel General
    Replies: 2
    Last Post: 05-31-2013, 12:50 PM
  5. [SOLVED] How to fixed date & time format conditionally
    By nur2544 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-24-2013, 01:39 PM
  6. incorrect date output when time and date strikes 12 midnight
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-22-2009, 10:04 AM
  7. Calculate current date from fixed time?
    By mandg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-01-2006, 03:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1