+ Reply to Thread
Results 1 to 11 of 11

Calculating elapsed time,respecting working hours.

  1. #1
    Registered User
    Join Date
    05-01-2009
    Location
    South Carolina
    MS-Off Ver
    Excel 2003
    Posts
    5

    Calculating elapsed time,respecting working hours.

    I am looking for a formula to calculate time from one date and time to another. The only catch is I only want it to use times during specific times.


    Example

    Start 5/1 8am and end 5/2 8am. The working hours are from 7am until 4pm and from 8pm till 5am. In this example the solution should be 17 hours.


    How do I set up a formula to respect only working hours (also excluding weekends except for Saturday early am from midnight until 5am.


    Sorry if this is confusing, I am trying to use IF statements but I’m fighting a losing battle.

    Thanks!

    CoryX
    Last edited by CoryX; 05-01-2009 at 05:10 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Calculating elapsed time,respecting working hours.

    Put together 5-10 sample time calculations showing the times and what the result should be. Make sure your sample set of data FULLY demonstrates all the hurdles to overcome and show the logic when it is isn't obvious.

    Click on GO ADVANCED and use the paperclip icon to post a sample sheet with all this in it to make it easier for us to help you.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-01-2009
    Location
    South Carolina
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Calculating elapsed time,respecting working hours.

    Thanks,

    Let me know if this works.
    Attached Files Attached Files

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating elapsed time,respecting working hours.

    You can use this formula in F3 copied down

    =(NETWORKDAYS(A3-1/4,C3-1/4)-1)*"19:00"+MOD(C3-1/4,1)-MOD(A3-1/4,1)+((MOD(C3-1/4,1)<"17:00"-1/4)-(MOD(A3-1/4,1)<"17:00"-1/4))*"3:00"

    see attached
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-01-2009
    Location
    South Carolina
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Calculating elapsed time,respecting working hours.

    Wow! You are awesome and fast.

    Great forum.

    CoryX

  6. #6
    Registered User
    Join Date
    09-14-2009
    Location
    delaware, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Calculating elapsed time,respecting working hours.

    I have been looking into different formulas. I want to calculate elapse time between 2 dates, and no weekends.

    can anyone help?

    Thank you

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Calculating elapsed time,respecting working hours.

    Hi flagonell. Welcome. Be sure to read through the Forum Rules so you can use and follow them effectively.

    For instance, you'll need to post your questions into new threads of your own.
    If you find this thread of possible interest, you can include a link to to it in your own thread.

    New threads typically get the most attention anyway. Read over the rules real quick, then post your question and I'm sure you'll get a lot of rapid suggestions.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating elapsed time,respecting working hours.

    Hello flagonell,

    JBeaucaire is quite right, "hijacking" threads is against forum rules, in any case from your description your query doesn't appear to relate specifically to this thread......and because it's marked as "Solved" few will bother to stop by.

    Please start your own thread

  9. #9
    Registered User
    Join Date
    04-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Calculating elapsed time,respecting working hours.

    hi

    We are facing the similar scenario.. but different timings.. can you please explain the logic of the formula

    Thanks

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating elapsed time,respecting working hours.

    Hello jaichu,

    The formula I suggested here was for a very specific scenario - could you please start your own thread and give an explanation of your requirements - which times you want to count, the possible start and end times (can they be outside the working hours?) and preferably a few examples - thanks
    Audere est facere

  11. #11
    Registered User
    Join Date
    04-10-2013
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Calculating elapsed time,respecting working hours.

    fine..i will do it immediately

+ 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