+ Reply to Thread
Results 1 to 8 of 8

Time Conversion

  1. #1
    Registered User
    Join Date
    10-10-2013
    Location
    Bangor, Maine
    MS-Off Ver
    Excel 2003
    Posts
    2

    Time Conversion

    An end user entered 8 pages of time data-but entered them all as straight numbers! How can I take a number like 2149 and convert it to 21:49? I'd be fine with just this conversion and then I could change the format to time, I think.

    If not, then: how do I take a straight number like 2149 and make it be the HH:MM 21:49? (I will be doing time calculations on this)

    Kitty

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

    Re: Time Conversion

    Assuming that number is in A1, you could do this in B1:

    =VALUE(INT(A1/100)&":"&MOD(A1,100)&":00")

    Format the cell as [h]:mm, then copy down. If you fix the values of those formulae in column B, then you could delete column A.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Time Conversion

    As
    Please Login or Register  to view this content.
    produces a time, you can do it in a small piece of VBA.
    Here is a draft (untested)

    Please Login or Register  to view this content.

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

    Re: Time Conversion

    You can try this. Assuming you have data in A1 and contains only 4 digits, then enter the below formula in B1.......

    =(LEFT(A1,LEN(A1)-2)&":"&RIGHT(A1,2))+0

    Hope it helps.
    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
    Registered User
    Join Date
    10-10-2013
    Location
    Bangor, Maine
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Time Conversion

    That's brilliant! For whatever reason, they both work and I would never have figured it out by myself! Thanks-you've just saved me a couple of hours of typing.

    One more question-and this is fairly obvious. I now have a column (A) that contains my original data: 1849 I have a column (B) that contains a forumla that references the first number, and shows as 18:49. How can I both delete column A and keep my number while keeping it formatted as time in B?

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Time Conversion

    Or

    =--text(a1, "0\:00")
    Entia non sunt multiplicanda sine necessitate

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

    Re: Time Conversion

    Quote Originally Posted by Kitty Tambling View Post
    How can I both delete column A and keep my number while keeping it formatted as time in B?
    That's what I referred to at the end of my post - you need to fix the values. To do that, select column B by clicking on the B at the top of the column, then click <copy> (or CTRL-C if you prefer), then right-click and choose Paste-special, then click against Values, then OK and press the <Esc> key. Now you can delete column A.

    Hope this helps.

    Pete

  8. #8
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Time Conversion

    Quote Originally Posted by shg View Post
    Or

    =--text(a1, "0\:00")
    That's rather beautiful with the caveat that I don't understand it!

+ 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. Date and time conversion to another time zone
    By RUBEN PARRAS in forum Excel General
    Replies: 1
    Last Post: 05-21-2012, 09:03 PM
  2. Time Conversion
    By malakingaso in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 06-19-2007, 04:02 AM
  3. Military time to Regular time Conversion
    By natepen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-13-2006, 02:43 PM
  4. [SOLVED] Time conversion
    By PivotMan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-13-2005, 11:05 AM
  5. Time Conversion
    By lim in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2005, 10:10 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