+ Reply to Thread
Results 1 to 5 of 5

Time Formatting

  1. #1
    Forum Contributor
    Join Date
    04-23-2014
    Location
    United Kingdom
    MS-Off Ver
    Microsoft 365
    Posts
    149

    Time Formatting

    I have a whole column of text-based time values that are set like this: 3:00pm, 7:45pm, 5:30pm etc. I need to convert them to recognised time-based values.

    What is the best way to convert them?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Time Formatting

    A few morning samples would have been nice too, but try this...
    A
    B
    23
    3:00pm
    3:00:00 PM
    24
    7:45pm
    7:45:00 PM
    25
    5:30pm
    5:30:00 PM

    B23=TIMEVALUE(LEFT(A23,LEN(A23)-2)&" "&RIGHT(A23,2))
    copied down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    04-23-2014
    Location
    United Kingdom
    MS-Off Ver
    Microsoft 365
    Posts
    149

    Re: Time Formatting

    Quote Originally Posted by FDibbins View Post
    A few morning samples would have been nice too, but try this...
    A
    B
    23
    3:00pm
    3:00:00 PM
    24
    7:45pm
    7:45:00 PM
    25
    5:30pm
    5:30:00 PM

    B23=TIMEVALUE(LEFT(A23,LEN(A23)-2)&" "&RIGHT(A23,2))
    copied down
    Ah, that works. And the reason I didn't give any morning samples was because I didn't have any of those. Thanks.

  4. #4
    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: Time Formatting

    A little-bit shorter
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 3:00pm 3:00:00 PM
    2 7:45pm 7:45:00 PM
    3 5:30pm 5:30:00 PM
    4 4:45am 4:45:00 AM
    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

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Time Formatting

    Happy to help and thanks for the feedback

    Nice 1 AlKey

+ 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. error with time formatting for negative time
    By dan_fash in forum Excel General
    Replies: 1
    Last Post: 03-03-2015, 10:51 AM
  2. Time Formatting - Not able to sum up the time when converted to text format.
    By sagarshinde01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-08-2013, 11:38 AM
  3. Formatting a total time entry and building a cumulative time formula.
    By TMc10 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-16-2012, 10:26 PM
  4. Replies: 3
    Last Post: 11-06-2012, 01:37 AM
  5. Replies: 6
    Last Post: 02-06-2012, 12:25 PM
  6. Replies: 4
    Last Post: 01-11-2012, 07:59 PM
  7. Replies: 2
    Last Post: 08-26-2009, 02:56 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