+ Reply to Thread
Results 1 to 3 of 3

Convert Text to time value

Hybrid View

  1. #1
    Registered User
    Join Date
    01-19-2006
    Posts
    10

    Convert Text to time value

    Hi

    I have a text value HH:MM:SS a/p.m. (eg 7:02:43 a.m. or 12:18:18 p.m.) and I need to convert this to a HH:MM:SS value in the 24 hour format to allow sequencial sorting.

    Can anyone help with the syntax please?

    Cheers
    Last edited by Hillheader; 03-02-2006 at 03:34 PM.

  2. #2
    Dave O
    Guest

    Re: Convert Text to time value

    With your sample time in cell A1, I got this formula to generate
    something appropriate:
    =TEXT(HOUR(A1),"00")&TEXT(MINUTE(A1),"00")

    ....where the time in A1 is an Excel-readable time format. Does that
    get you close?


  3. #3
    Registered User
    Join Date
    01-19-2006
    Posts
    10
    Dave

    Thanks for taking the time to reply.

    In searching further I actually found an even quicker way. If I simply replace the "a.m." with "AM" and the "p.m." with "PM" it changes the structure of the cell so that formatting the column now does the convertion for me.

    Again thanks for the reply. Much appreciated

+ 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