+ Reply to Thread
Results 1 to 5 of 5

Getting Time difference

Hybrid View

  1. #1
    Registered User
    Join Date
    08-03-2006
    Posts
    60

    Getting Time difference


    Start time End time Run Time

    14.42.52 14.43.26 #VALUE!
    07.17.57 07.18.00
    In the Run time column I need the difference between end-time and start-time. All three columns are formatted to category - TIME. I put in the formula on Run time column as =TEXT(E4-D4,"h:mm:ss"). This formula is not resolving the time difference, can some one help in this ?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    You should need to use the Text Function.

    I just did the below.

    I did have to re-enter your figures as HH:MM:SS first

    =IF((D4-E4)<0,E4-D4,D4-E4)

    VBA Noob

  3. #3
    Registered User
    Join Date
    08-03-2006
    Posts
    60
    I just tried this IF((D4-E4)<0,E4-D4,D4-E4), Still getting error #VALUE!, Any more ideas ?

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Excel won't normally recognise 14.42.52 as a time.

    If you input times with colons, i.e. as 14:42:52 then for the time difference use the formula

    =E4-D4+(D4>E4)

    format result cell as time, e.g. hh:mm:ss

    otherwise if you retain the format of 14.42.52 you can use this formula for the time difference

    =MOD(SUBSTITUTE(E4,".",":")-SUBSTITUTE(D4,".",":"),1)

    again, format result cel as a time

  5. #5
    Registered User
    Join Date
    08-03-2006
    Posts
    60
    Thank you Daddy, this works great ...

+ 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