+ Reply to Thread
Results 1 to 9 of 9

Extract time and date from Text

  1. #1
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Extract time and date from Text

    I have rows of date and time in text format and it looks like this - May 13, 2012 9:10 AM
    (pls note that the time could also be 4 digits, eg: 12:11 PM)

    Looking for help for formulas

    1) To extract the date in another row in DD-MM-YYYY format
    2) To extract the time in another row in 24 hours clock format, eg: 15:14, 09:15


    Btw, I have also asked the same question in another forum, but couldn't get the answer, thus this repost in this forum)
    Pls see the orginal post here - http://www.mrexcel.com/forum/excel-q...date-text.html
    Thanks much!
    Last edited by zxchan; 06-29-2014 at 10:26 PM. Reason: show link to original post as required for cross posting

  2. #2
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Extract time and date from Text

    It is a cross post
    Please add link of your thread in the form you have posted earlier
    Thanks
    Mark the thread as solved if you are satisfied with the answer.


    In your first post under the thread tools.

    Mahju

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Extract time and date from Text

    Try these two

    For date

    =--LEFT(A1,12)

    Format Custom: DD-MM-YYYY

    For time

    =--TRIM(RIGHT(A1,8))

    Format Custom: [h]:mm

    These formulas will convert text date/time to real values however, if you simply want to separate date and time and leave them as text use formulas below:

    =TEXT(A1,"dd-mm-yyyy")

    =TEXT(A1,"h:mm")

    A
    B
    C
    1
    May 13, 2012 9:10 AM
    13-05-2012
    9:10
    Last edited by AlKey; 06-26-2014 at 06:30 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Extract time and date from Text

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Forum Contributor
    Join Date
    07-10-2012
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: Extract time and date from Text

    use this

    =+TEXT(A1,"DD/MM/YYYY") =+TEXT(A1,"HH:MM AM/PM")

  6. #6
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Extract time and date from Text

    Mahju,sktneer - thanks for informing. I have included the link to the original post.

    Alkey,morevijay1982 - thanks for the help, the formula for the time works (ie: =--TRIM(RIGHT(A1,8)). However, the others formulas doesn't work. I tried to change the custom format already but its still not showing the desired result.
    Not sure if its due to the original cell in column I.

    Attached is the raw data, the data is in coloumn I. Need the date in column J and time in column K.
    Can help again pls? thanks
    Attached Files Attached Files

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Extract time and date from Text

    Please see attached file.
    Attached Files Attached Files

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Extract time and date from Text

    Please find the attached File
    Attached Files Attached Files
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  9. #9
    Registered User
    Join Date
    04-21-2012
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Extract time and date from Text

    HI Alkey,

    thanks, but i click on the cells J3 and K3, they turn into "#VALUE!"
    Not sure why is that so.

    Anyone can advise on this? thanks
    Quote Originally Posted by AlKey View Post
    Please see attached file.

+ 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] Extract time from date and time text string
    By pattem2013 in forum Excel General
    Replies: 5
    Last Post: 09-07-2013, 03:20 AM
  2. How can I extract an undated time value from a date/time field?
    By NPB in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-06-2013, 08:47 AM
  3. [SOLVED] Extract a time from a cell with date and time stamp and then perform calculations
    By Marcos Aristotelous in forum Excel General
    Replies: 3
    Last Post: 10-31-2012, 04:36 AM
  4. Replies: 4
    Last Post: 12-02-2011, 02:41 PM
  5. Replies: 4
    Last Post: 03-23-2010, 12:44 PM

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