+ Reply to Thread
Results 1 to 4 of 4

calculate elapsed time

  1. #1
    Registered User
    Join Date
    07-23-2008
    Location
    New Zealand
    Posts
    4

    calculate elapsed time

    Hi everyone,
    Probably a really simple problem but I can't seem to figure it out from reading excel help files. I'm trying to create a worksheet which will calculate the running times of individual components (or episodes) on DVDs. The user will enter the end time of each component in Column A (formatted in minutes and seconds) and the worksheet will subtract the endtime just entered from the endtime in the sell above giving the running time of that component (in minutes and seconds).

    Example:
    The user enters the following values into column A: 23:41, 47:04, 01:11:16, 01:35:14.
    The worksheet returns the following values in column B: 23:41, 23:23, 24:12, 23:58.

    Also, it would be good to not have to enter colons/full stops between minutes and seconds in column A.
    Example: entering 012506 and hitting enter will automatically convert to 01:25:06 in column A.

    I'm using Excel 2007.
    Thanks in advance for your help.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    If you enter the data as valid times then you have to also enter the hours, i.e. 0:23:41 (otherwise Excel will interpret 23:41 as 23 hours and 41 minutes)

    If you have A1 blank and enter the time data in A2 down then you can use this formula in B2 copied down

    =A2-A1

    If you want to enter without colons you'll need VBA to actually convert to a valid time on entry......or you can enter 12506 (you dont need any leading zeroes) and make it display like a time by formatting column A as

    00\:00\:00

    ...but because this isn't really a time (the underlying value is still the number 12506) you need a slightly more complex formula to calculate the difference, i.e. in B2 again

    =TEXT(A2,"00\:00\:00")-TEXT(A1,"00\:00\:00")

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Maybe like this:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-23-2008
    Location
    New Zealand
    Posts
    4

    Cool Thanks

    Thanks for both of those solutions - even a novice like me was able to make them both work.
    Cheers!

+ 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