+ Reply to Thread
Results 1 to 10 of 10

Working with Time in Excel

  1. #1
    Registered User
    Join Date
    10-07-2010
    Location
    Georgia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Working with Time in Excel

    I need to make a worksheet that will track time spent on a certain task. I need to be able to calculate time spent but some times may overlap. For instance:
    9:15 - 9:30 15 minutes
    9:20 - 11:00 100 inutes
    9:25 - 10:00 35 minutes

    If I add all of these up it would be a total of 150 minutes but since some of them overlapped the actual time spent was 105 minutes.

    I hope that makes sense. It seems like it should be fairly simple to do but I just can't seem to make it work.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Working with Time in Excel

    Welcome to the forum.

    If there are no gaps, how about =MAX(B1:B3)-MIN(A1:A3)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-15-2010
    Location
    Never Never Land
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Working with Time in Excel

    If hours and minutes will work,
    Column A Start Time, Column B Stop Time, Column C Total Time.

    Column C =B1-A1

    AutoSum Column C which should return something like 2:30

  4. #4
    Registered User
    Join Date
    10-07-2010
    Location
    Georgia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Working with Time in Excel

    Thanks guys but neither of those will do what I need.

    shg, There are gaps. If there were no gap I wouldn't need a spreadsheet I would just use the beginning and ending hours and that would be all I would need.

    Stupidav, This would give me the total of the hours, I need to exclude the times that overlap.

    Maybe a better explanation is needed. I am monitoring time spent working electrical outages in a Dispatch center. There may be multiple outages occurring at the same time. There are also gaps in time where there are no outages. I can pull a report that has my total outage hours on it but that does not give me what I need. Example: A dispatcher could have 3 outages in a one our period. One of the outages could have been the full hour long and the other two may have been 15 and 30 minutes which would be 1 hr and 45 minutes of outage time but the Dispatcher only worked one hour.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Working with Time in Excel

    Quote Originally Posted by mountaincruiser
    Maybe a better explanation is needed...
    Better still post a sample file ... a good sample file will generally account for half a dozen posts.

    In the sample ensure the data accurate reflects your real file in terms of ranges used, data types etc... also outline the expected results as this helps people validate logic.

  6. #6
    Registered User
    Join Date
    10-07-2010
    Location
    Georgia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Working with Time in Excel

    Quote Originally Posted by DonkeyOte View Post
    Better still post a sample file ... a good sample file will generally account for half a dozen posts.

    In the sample ensure the data accurate reflects your real file in terms of ranges used, data types etc... also outline the expected results as this helps people validate logic.
    I have attached a file. The highlighted cells are the ones that I need to track. I can easily add up the total # of outage hours. Where I am having a problem is excluding overlapping times.
    Attached Files Attached Files

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Working with Time in Excel

    These types of things can get quite complicated using native formulae especially if as is the case here the data is not sorted by Start.

    Can you confirm expected output given sample - I think I calculated at 55:58:29 but I didn't spend long working through it.

    Also, to be clear - this is not a "simplified" version of your real file ?

    I ask because often "outage" analysis tends to be based on multiple factors - eg machine 1 & machine 2 being down simultaneously.
    This means there is often there are additional clauses determining which datetime values are included in analysis - and if that's the case here it would be good to know now.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Working with Time in Excel

    I assigned the outage events = -1 and the online events as =+1, then commingled the times and sorted to arrive at the same answer as DO:

    Please Login or Register  to view this content.
    DO, how did you do it?

    This could be done via a UDF rather than needing to rearrange the data.
    Last edited by shg; 10-08-2010 at 11:21 AM.

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Working with Time in Excel

    Quote Originally Posted by shg
    DO, how did you do it?
    It seems the data is sorted by OutageRecID and on occasion it seems this can be out of sequence regards time (A6/A5, A19/A18 etc)

    If the data (A:F) is sorted by Column A (Start) rather than by OutageRecID then:

    Please Login or Register  to view this content.
    result being sum of J2:J41

    If Duration of any given outage can exceed 24 hours avoid using TIME in Column I, rather use:

    Please Login or Register  to view this content.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Working with Time in Excel

    That is so simple; very nicely done.

+ 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