+ Reply to Thread
Results 1 to 4 of 4

Need help converting a text field to a date Time field that can be used in calculations

  1. #1
    Registered User
    Join Date
    12-10-2012
    Location
    Boston MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Need help converting a text field to a date Time field that can be used in calculations

    Hello,

    I'm importing a text file that each row includes a string of numbers such as 201407221430 that represents 7/22/2014 2:30 pm. I need to calculate the elapsed time between rows. I'm importing it using the Get Data from Text option and I cant seem to get the field in question the correct format.

    Thanks in advance

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,919

    Re: Need help converting a text field to a date Time field that can be used in calculation

    Assuming the string is in cell A1, you could use the below to do the trick.

    =DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))+TIME(MID(A1,9,2),RIGHT(A1,2),0)

    Seems a bit long winded. I'm sure someone that is more awake than I am right now can provide a much neater answer...

  3. #3
    Registered User
    Join Date
    12-10-2012
    Location
    Boston MA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Need help converting a text field to a date Time field that can be used in calculation

    Works like a Charm!!!!! Thank you.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,919

    Re: Need help converting a text field to a date Time field that can be used in calculation

    No worries. Happy to help.

    Feel free to mark the thread as SOLVED if you're happy with the solution.
    But keep an eye out for a better one...

+ 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 AD Field 'lastLogon' to Date & Time
    By Brelin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-11-2013, 08:37 PM
  2. Converting a date field into a month-year only field
    By C.Hirsch in forum Excel General
    Replies: 1
    Last Post: 04-24-2006, 07:15 PM
  3. [SOLVED] Changing a text field to a date field
    By juliet in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 02-21-2006, 05:55 PM
  4. Replies: 4
    Last Post: 08-09-2005, 06:05 PM
  5. Converting Text Field to Time
    By A P in forum Excel General
    Replies: 7
    Last Post: 03-15-2005, 06:06 AM

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