+ Reply to Thread
Results 1 to 4 of 4

Converting a text string date+time

  1. #1
    Registered User
    Join Date
    03-01-2017
    Location
    Italy
    MS-Off Ver
    14.0.7177.5000 (32 bit) Italian localization, part of Office 2010
    Posts
    2

    Converting a text string date+time

    Hello, I'm looking for a way to convert a text string into a format that Excel recognizes as date+time. Excel version used is 14.0.7177.5000 (32 bit) Italian localization, part of Office 2010

    My source text format is like this inside a single cell

    Feb 15, 2017 3:01:01 PM

    I need to convert into anything that is recognized as date + time in a single cell (should be in a single cell because I'll use these dates to plot data into a chart)

    I have tried a number of options
    • Changing cell format from text to date (or to time), but the source text string is not interpreted and the output is not treated as date+hour
    • Sorting day-month-year-hour with a series of MID() and CONCATENATE() functions, but the output is still not recognized as date-hour. Used formula was =MID(A1,5,2)&CONCATENATE("/")&MID(A1,1,3)&CONCATENATE("/")&MID(A1,9,4)&CONCATENATE(" ")&MID(A1,14,15) where A1 is a cell containing the source text
    • DATEVALUE() formula: only manages dates without time
    • TIMEVALUE() formula: only manages hours, even if the final formatting includes dates, the formula ignores anything in the input that is not an hour (as stated in the Excel documentation)


    Thank you in advance for any idea and help you may provide

  2. #2
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: Converting a text string date+time

    •DATEVALUE() formula: only manages dates without time
    •TIMEVALUE() formula: only manages hours, even if the final formatting includes dates, the formula ignores anything in the input that is not an hour (as stated in the Excel documentation)

    Did you try: DATEVALUE() formula + TIMEVALUE() formula

  3. #3
    Registered User
    Join Date
    03-01-2017
    Location
    Italy
    MS-Off Ver
    14.0.7177.5000 (32 bit) Italian localization, part of Office 2010
    Posts
    2

    Re: Converting a text string date+time

    Indi_Ra, your idea works great! I didn't think of combining the 2 formulas. Thank you!

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,817

    Re: Converting a text string date+time

    shame you did not post the link to your other forum,I would have saved some time
    However, your formula will only work , if days 1-9 are displayed as 01-09

    https://www.mrexcel.com/forum/excel-...ml#post4768241

    =DATEVALUE(MID(A1,(SEARCH(",",A1,1)-2),2)&CONCATENATE("/")&MID(A1,1,3)&CONCATENATE("/")&MID(A1,SEARCH(",",A1,1)+1,5))+TIMEVALUE(MID(A1,13,17) )
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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. Converting text string to date
    By gueh in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-21-2016, 01:50 PM
  2. Converting a string of text into a date.
    By sungen99 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-26-2014, 01:23 PM
  3. Converting text string that contains a date and time to a date
    By jmforde in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2013, 02:31 PM
  4. [SOLVED] Converting this date/time string into number
    By coderboy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-28-2013, 03:54 AM
  5. Converting a text string to date and time
    By stephboucher in forum Excel General
    Replies: 1
    Last Post: 03-21-2012, 02:28 PM
  6. Converting text string to a its proper time format
    By Edmund Wong in forum Excel General
    Replies: 3
    Last Post: 10-20-2005, 08:05 PM
  7. [SOLVED] Converting Date to Text String
    By John Calder in forum Excel General
    Replies: 3
    Last Post: 04-08-2005, 07:06 AM

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