+ Reply to Thread
Results 1 to 6 of 6

Summation of Time Stamps

  1. #1
    Registered User
    Join Date
    12-08-2017
    Location
    Colorado, USA
    MS-Off Ver
    2016
    Posts
    3

    Exclamation Summation of Time Stamps

    Excel file has a running time stamp (00:00:00 up to 23:59:59). Three columns where values for certain rows oscillate between 0 and 1023, nothing in between those two numbers, just a 0 or 1023. What I would like to do is sum up the time elapsed for when a certain column reads 1023. I've tried SUMIF, but that simply adds up the hrs, min, and sec. I need to add up the time elapsed between the a column changes to 1023 and when it changes back to 0. It happens rather often.

    Looking for a formula where it will take the end of the time elapsed (i.e. when a value changes from 1023 to 0), subtract it from the beginning (i.e. when a value changes from 0 to 1023), and then repeat that for an entire column. Haven't had much luck so far.

    See attached workbook.
    Attached Files Attached Files
    Last edited by FMoynihan; 12-08-2017 at 12:38 PM.

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Summation of Time Stamps

    Hi FMonyhan, welcome to Excel Forum! A small sample workbook (NOT a picture) would really help us to solve your problem quickly and accurately.
    Please remove any personal or proprietary information.
    Try to preserve the original layout so our solutions fit your workbook.
    Provide “realistic” data. Include any variations the code or formula must address.
    If appropriate, simulate some results to demonstrate what you want.

    To attach a workbook:
    Click Edit Post (or just start a new reply.)
    Click Go Advanced
    Scroll down to Manage Attachments and click.
    Now click Browse, find your file, then click Upload. Simple!
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Registered User
    Join Date
    12-08-2017
    Location
    Colorado, USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Summation of Time Stamps

    Hi leelnich, thank you! You'll find a workbook attached. I haven't had much luck putting my logic into effect as of yet, so I haven't included any simulated results.

    Appreciate any help/guidance you can provide.

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Summation of Time Stamps

    Actually, "Col 1" (B) AND "Col 3"(D) contain "321". I assume you're suggesting using "Col 2"(C).

  5. #5
    Registered User
    Join Date
    12-08-2017
    Location
    Colorado, USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Summation of Time Stamps

    Yes. Apologies, I've never dealt with a workbook of this size. Easy to get lost.

    I believe I've found part of the solution: =IF(AND(D30=1023,D29=1023),A30-A29,"")

    This would account for large sequences of 1023, but it doesn't account for 321 or single values of 1023. I could use the same structure for 321s. For single values of 1023, I believe it would work to say =IF(AND(D31=0,D30=1023,D29=0),A31-A29,"").

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Summation of Time Stamps

    Try this:
    Please Login or Register  to view this content.
    It uses 3 clauses that generate TRUE/FALSE arrays for the entire range. The first determines if each element (starting with the second) is NOT equal to the previous element. The remaining two determine if a "run" is starting or ending. When combined mathematically, they yield a value of -1 (starting), 0 (ignored), or 1 (ending) for each cell in the check range. This value is then multiplied by the corresponding time, yielding an array of -starting and +ending times that can be SUMed. Finally, the total is adjusted for special cases : first cell = 1023 , last cell = 1023.

    12:09:49
    1023
    -1
    12:09:51
    1023
    0
    12:09:51
    1023
    0
    12:09:54
    0
    1
    12:09:54
    0
    0


    Just to be clear, the example run shown above would count as 5 seconds : 12:09:54 - 12:09:49
    Last edited by leelnich; 12-10-2017 at 04:46 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Create a Time Range off Time Stamps, and Count Intersecting values
    By athyeh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2014, 05:07 PM
  2. [SOLVED] Difference between two time stamps
    By Thinker8 in forum Excel General
    Replies: 2
    Last Post: 09-24-2013, 03:17 AM
  3. Converting time stamps to time intervals
    By enhydra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2011, 04:51 PM
  4. Time Difference in hours between two date time stamps
    By Cipher in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-17-2010, 10:24 AM
  5. Excel time-stamps - per row?
    By scottmcglasson in forum Excel General
    Replies: 1
    Last Post: 12-08-2008, 10:13 AM
  6. Replies: 5
    Last Post: 06-22-2006, 08:25 AM
  7. time stamps detailing last save time
    By sam1 in forum Excel General
    Replies: 4
    Last Post: 01-12-2005, 03:21 PM

Tags for this Thread

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