+ Reply to Thread
Results 1 to 5 of 5

Converting text string that contains a date and time to a date

  1. #1
    Registered User
    Join Date
    02-20-2010
    Location
    Orange Park, FL
    MS-Off Ver
    MS Office 2010
    Posts
    3

    Converting text string that contains a date and time to a date

    I have given up on Healthvault correcting some issues with their site and am now trying to make a spreadsheet that will plot the data as I want. When I export the data to excel, I get text strings for all, including a date/time string as follows: "6/12/2013 11:04:24.000 AM EDT" Does anyone have any suggestion on how I can convert this text string to an actual date/time string so I can plot the data correctly? The month and day text are variable in length (i.e., 1/1/2013, 12/12/2013, etc.) and the hours in the time text are variable in length, as well. Minutes and seconds appear to be fixed at two digits each, and years at 4 digits each.

    It has been years since I have done anything but the most basic of formulas, so any input would be welcome and appreciated!

    Mike

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Converting text string that contains a date and time to a date

    Mike

    You can try DATEVALUE to get the date, you'll need to format the result.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    02-20-2010
    Location
    Orange Park, FL
    MS-Off Ver
    MS Office 2010
    Posts
    3

    Re: Converting text string that contains a date and time to a date

    OK, that worked great. Thanks! Building upon that, to isolate the time, I have used three steps: First using the SUBSTITUTE function to eliminate the " EDT" from the end of the string, then second, the same SUBSTITUTE function to eliminate the ".000" from the time. Finally I modified your formula to use TIMEVALUE and RIGHT to replace DATEVALUE and LEFT, and all works just fine now. I have isolated the date and time values. That may be a long way around to my solution (and still need to incorporate the time with the date somehow to properly plot several readings on the same date), but it works for now and has been a fun exercise. Just wish I had more time to refine it.

    Thanks again!

    Mike

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: Converting text string that contains a date and time to a date

    Mike

    Oops, I thought you just wanted the date not date/time.

    Give this a try.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Again you'll need to format the result.

  5. #5
    Registered User
    Join Date
    02-20-2010
    Location
    Orange Park, FL
    MS-Off Ver
    MS Office 2010
    Posts
    3

    Re: Converting text string that contains a date and time to a date

    Wow! Seems to work very well! Now I will need to figure out why it works (my **** nature). Thank you so much for your help!

    Mike

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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