+ Reply to Thread
Results 1 to 3 of 3

Converting numbers to Time

  1. #1
    Registered User
    Join Date
    03-15-2009
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2007
    Posts
    1

    Converting numbers to Time

    I seem to be in a fix as I am trying to do some calculations in excel. Now doing simple adding and subtracting would not be a problem;however, the format of the data I have in the excel file is the data type numbers and it is in HHMM. Now I wish to convert that into the excel time data type and have it read as HH:MM so that I may do other calculations with it. Since if I leave it as numbers, if I do an operation such as [assume the following are in a 24 hour clock in the format HHMM, and the excel data type numbers] 1145 + 0115 would result in 1260 and not 1300 as need.

    Thus, I was wondering if there is any way to convert the data type from numbers to time.
    Last edited by VBA Noob; 03-15-2009 at 03:46 PM.

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

    Re: Converting numbers to Time

    To convert hhmm to hh:mm

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

    format as time

    so if you have 1145 in A1 and 0115 (or just 115) in B1 then you can use this formula in C1

    =TEXT(A1,"00\:00")+TEXT(B1,"00\:00")

    format C1 as hh:mm to see 13:00

    If you want to get 1300 (without colon) then try

    =TEXT(TEXT(A1,"00\:00")+TEXT(B1,"00\:00"),"hhmm")+0

  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: Converting numbers to Time

    With
    A1:A2 containing your posted pseudo-time: HHMM

    This formula sums those values in the same HHMM formatted

    Please Login or Register  to view this content.
    Does that help?
    Last edited by Ron Coderre; 03-15-2009 at 04:14 PM. Reason: Tweaked the time format...in case more than 24 hrs
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

+ 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