+ Reply to Thread
Results 1 to 3 of 3

Calculating time length based on cell references

  1. #1
    Registered User
    Join Date
    09-09-2013
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Calculating time length based on cell references

    Hi everyone,

    I am trying to calculate total time by subtracting a later time from an earlier time based upon when the "POD POS" changes back to a value of 1 in the example below:

    In the following set of data where time is in one column and "POD POS" is in another:

    TIME POD POS
    5:08:09 1
    5:08:27 2
    5:08:44 3
    5:09:14 4
    5:09:28 5
    5:09:44 6
    5:10:14 7
    5:12:02 1
    5:12:12 2
    5:12:42 3
    5:13:12 4
    5:13:42 5
    5:14:12 6
    5:14:42 7
    5:20:57 1
    5:21:27 2
    5:21:58 3
    5:22:27 4
    5:22:57 5
    5:27:25 1

    I need to know what the total time elapsed between 1 and 7 is, etc. until the number in the "POD POS" column changes back to 1, then I need to repeat. So in the first set that runs from 1 to 7, I need to return a value of what 5:10:14 - 5:08:09 is. The string of data does not always end at 7 items, and could be longer or shorter. This data goes on for about 4000 rows, so it is something I need to replicate down a column. I need to return a total in the first set of 1-7 of 0:02:05 (the seventh value minus the first), and repeat that in the next set for a value of 0:02:40, and so on.

    Any thoughts or insight are greatly appreciated.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Calculating time length based on cell references

    See the attached. Copy formula in C2 down as far as you need to.

    Hope this helps.

    Pete
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-09-2013
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Calculating time length based on cell references

    Thanks, this nearly worked. It did work as advertised for the short list of data I sent though.

    I ultimately found another solution that made my client happy.

+ 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. Replies: 3
    Last Post: 05-28-2013, 10:43 AM
  2. Calculating END time based on start time, breaks, and hours to complete
    By sweedey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2012, 11:29 AM
  3. Calculating Time Owed based on Time Worked
    By Tony Vargo in forum Excel General
    Replies: 9
    Last Post: 06-23-2009, 11:30 AM
  4. Calculating cell references
    By YoungGuy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2006, 01:01 PM
  5. Replies: 2
    Last Post: 03-15-2005, 04:06 PM

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