+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Valued Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Eastlake Ohio
    MS-Off Ver
    2010
    Posts
    1,000

    Calculating a Run Time from values

    I have only found info on "time stamps" in excel, I am trying to take a series of time values and add them to find the "Run Time" of an application.
    Example out put value Ignore anything in brackets():
    Time
    12:43:01:297 (Start)
    Time
    13:30:14:852 (Pause)
    13:30:20:770 (Restart)
    Time
    13:31:44:611 (Pause)
    13:32:38:698 (Restart)
    Time
    14:15:13:722 (End)
    Total Run Time = ?
    All of the data is in column A, the word "Time" is a word used to "find" the time strings with in another file, it can be ignored.

    I am only concerned with hh:mm:ss the remaining value can be ignored.

    Any hints, tips or examples are welcome.
    Regards

    Rick
    Win7, Office 2010

  2. #2
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,135

    Re: Calculating a Run Time from values

    If you convert the times to something Excel recognizes, and the parenthetic stuff is is a separate column, then

    =SUMIF(B1:B10, {"(End)","(Pause)"}, A1:A10) - SUMIF(B1:B10, {"(Start)","(Restart)"}, A1:A10) returns 01:32:12

    Code:
           -----A------ ----B---- -----C------ -----------------------------------------------D------------------------------------------------
       1                            Elapsed:                                                                                                   
       2                          01:32:12.425 C2: =SUMIF(B4:B13, {"(End)","(Pause)"}, C4:C13) - SUMIF(B4:B13, {"(Start)","(Restart)"}, C4:C13)
       3       Text       Event       Time                                                                                                     
       4   Time                                C4 and down: =IF(OR(LEFT(A4)={"0","1"}), LEFT(A4, 8) + RIGHT(A4, 3)/86400000, 0)                
       5   12:43:01:297 (Start)   12:43:01.297                                                                                                 
       6   Time                                                                                                                                
       7   13:30:14:852 (Pause)   13:30:14.852                                                                                                 
       8   13:30:20:770 (Restart) 13:30:20.770                                                                                                 
       9   Time                                                                                                                                
      10   13:31:44:611 (Pause)   13:31:44.611                                                                                                 
      11   13:32:38:698 (Restart) 13:32:38.698                                                                                                 
      12   Time                                                                                                                                
      13   14:15:13:722 (End)     14:15:13.722
    Last edited by shg; 03-20-2010 at 01:52 PM.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Valued Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Eastlake Ohio
    MS-Off Ver
    2010
    Posts
    1,000

    Re: Calculating a Run Time from values

    Thnak you, I will continue with your suggestion and example on Monday.
    Regards

    Rick
    Win7, Office 2010

  4. #4
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,135

    Re: Calculating a Run Time from values

    I used text to columns to separate the time string from the event type, and a formula to convert the time string to an Excel time. The elapsed time formula in the example is different from the formula in the post (it uses col C for the times).

    Holler back if you have problems.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Valued Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Eastlake Ohio
    MS-Off Ver
    2010
    Posts
    1,000

    Re: Calculating a Run Time from values

    Formulas! Argh!
    Something is lost in translation. LOL

    I attached a couple files, Column A is added, Column B is as imported.
    The number of rows will vary.
    Sheet1 is my data, ignore sheet 2, sheet3 is where I tried to duplicate your formula scenerio.

    Any hints, tips or examples are welcome.

    With one of your formulas
    Code:
    =IF(OR(LEFT(A26)={"0","1"}), LEFT(A26, 8) + RIGHT(A26, 3)/86400000, 0)
    I get #VALUE on rows 26 and 29?
    Edit: Figured that out, your code seems to want specific character length such as:
    14:13:28:000
    rather than
    14:13:28:00
    Attached Files Attached Files
    Last edited by Rick_Stanich; 03-22-2010 at 10:48 AM.
    Regards

    Rick
    Win7, Office 2010

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.2.0