+ Reply to Thread
Results 1 to 5 of 5

convert number to time

  1. #1
    Registered User
    Join Date
    01-12-2011
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel Mac 2008
    Posts
    2

    convert number to time

    I want to convert a numerical entry into a time value, displayed as HH:MM:SS. For example:

    User inputs 136, cell would display 1:36
    User inputs 25, cell would display :25
    User inputs 20348, cell would display 2:03:48

    The displayed numbers need to be time format, they will be added and subtracted to other time values. I hope this makes sense.

  2. #2
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: covert number to time

    With this formula it will include seconds, TEXT(H15,"00\:00\:00")+0 if you type 2500 in H15 you'll get 00:25:00 for 25 minutes. if you only want to type 2 or 3 numbers ie 25 = 25mins then lose the seconds counterTEXT(H15,"00\:00")+0. I can't make it work the way you want but i can imagine it can be written into an if statement
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: covert number to time

    With the understanding that this numeric format won't actually convert the value to a time, it WILL display it as a time.

    Please Login or Register  to view this content.
    Apply that format to all of the "time" values.

    You could then use this kind of formula to sum those "times" into an actual time value:
    Please Login or Register  to view this content.


    EDITED TO INCLUDE THIS EXAMPLE:
    Please Login or Register  to view this content.

    And the formula aboves sums those numbers into this time: 1:01:01


    Is that something you can work with?
    Last edited by Ron Coderre; 01-12-2011 at 09:24 PM. Reason: corrected a typo-> :00 should have been :01
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: covert number to time

    output with this TEXT(H15,"00\:00\:00")+0 <---25 00:00:25
    output with this TEXT(H16,"00\:00")+0 <-----25 00:25:00

    with this formula combined with len
    25 00:25:00
    20348 02:03:48
    =IF(LEN(H16)<4,TEXT(H16,"00\:00")+0,TEXT(H16,"00\:00\:00"))+0
    perhaps

  5. #5
    Registered User
    Join Date
    01-12-2011
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel Mac 2008
    Posts
    2

    Re: convert number to time

    Thanks guys, I'll give these a try....as soon as I can figure out how to input the formulas. Very new at this!

+ 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