+ Reply to Thread
Results 1 to 4 of 4

How do i turn a column of these (62000) into this (06:20:00)

  1. #1
    Registered User
    Join Date
    09-06-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    5

    How do i turn a column of these (62000) into this (06:20:00)

    Hi Guys

    I have a problem. I've been trying to make an add-in that compares two columns and highlights any times that are more than 15 minutes apart.

    The only problem, is that one of the columns is in hh:mm:ss format and the other is just numerical.

    I've attached the file if anyone wants a closer look.

    I'm eally stuck and would appreciate any help

    Thanks

    Colin
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How do i turn a column of these (62000) into this (06:20:00)

    E1: =TIMEVALUE(LEFT(B1,8)&"."&RIGHT(B1,2))
    F1: =TIMEVALUE(IF(LEN(C1)=5, TEXT(LEFT(C1,1),"00:")&TEXT(MID(C1,2,2),"00:")&RIGHT(C1,2), TEXT(LEFT(C1,2),"00:")&TEXT(MID(C1,3,2),"00:")&RIGHT(C1,2)))
    G1: =ABS(E1-F1)

    Copy those 3 cells downward.

    Highlight those 3 columns and apply a custom number format of: [h]:mm:ss.00

    Note in some rows E>F, in other F>E. The ABS() function in column G will always subtract the higher number from the lower.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: How do i turn a column of these (62000) into this (06:20:00)

    You could put this formula in E1:

    =IF(LEN(C1)=5,"0","")&LEFT(C1,LEN(C1)-4)&":"&MID(C1,LEN(C1)-3,2)&":"&RIGHT(C1,2)

    and copy down. This is a text value that looks like a time - if you want it as an Excel time then you can do this:

    =--(IF(LEN(C1)=5,"0","")&LEFT(C1,LEN(C1)-4)&":"&MID(C1,LEN(C1)-3,2)&":"&RIGHT(C1,2))

    and format as time. Note, though, that column B is not in time format, as there are 4 sets of numbers separated by colons.

    Hope this helps.

    Pete

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: How do i turn a column of these (62000) into this (06:20:00)

    You can convert C1 with this formula

    =TEXT(C1,"00\:00\:00")+0

    format as time

    ...or you could get the difference directly with this formula

    SUBSTITUTE(B1,":",".",3)-TEXT(C1,"00\:00\:00")

    As Jerry says, in some rows that will be negative, do you want to show negative values?
    Last edited by daddylonglegs; 09-15-2012 at 09:09 AM.
    Audere est facere

+ 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