+ Reply to Thread
Results 1 to 5 of 5

count timedifference between 2 times without weekends

  1. #1
    Registered User
    Join Date
    12-04-2012
    Location
    belgium
    MS-Off Ver
    Excel 2010
    Posts
    7

    count timedifference between 2 times without weekends

    i want a formula to count the amount of days and hours between 2 times.
    i'm working in office 2010.
    and i'm using the 24hour timerate.

    i have for example 2 dates where i would like to know the amount of time it took between the 2 but without the weekends
    so for example:
    a1:7/2/2013 08:46
    b1: 11/02/13 12:00
    c1: the time inbetween without the weekends.

    i've already seen some formulas like the networkdays and then you have to use the int function.
    but haven't seen any example as my ow (or i didn't manage to convert to my own)

    thx for the help in advance

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: count timedifference between 2 times without weekends

    Deleted post.
    Last edited by Kevin UK; 06-11-2013 at 12:36 PM.
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: count timedifference between 2 times without weekends

    Format the answer cell as dd h:mm

    enter this formula in that cell: =(B1-A1)-2

    oops...that isn't rght

    I had to add helper columns to get what appears to be the solution. Perhaps the process can be modified to shorten it. I tried but ran out of time.
    Attached Files Attached Files
    Last edited by newdoverman; 06-11-2013 at 07:24 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: count timedifference between 2 times without weekends

    Hi christiaan.spriet

    As you have Excel 2010, you could use the NETWORKDAYS.INTL. Try the following formula in C1, format cells as "[h]:MM" (without the quotes) to display the time in hours.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Kevin UK; 06-12-2013 at 01:13 AM.

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

    Re: count timedifference between 2 times without weekends

    Quote Originally Posted by christiaan.spriet View Post
    i have for example 2 dates where i would like to know the amount of time it took between the 2 but without the weekends
    so for example:
    a1:7/2/2013 08:46
    b1: 11/02/13 12:00
    c1: the time inbetween without the weekends.
    So what's the expected result for C1? I assume it's 2:03:14 (formatted as d:hh:mm)

    d:hh:mm format is problematic because d doesn't go any higher than 31, so if you have time periods that may be larger than 31 working days you won't be able to use that format. For periods shorter than 31 working days you can use this formula

    =NETWORKDAYS(A2,B2)-1+MOD(B2,1)-MOD(A2,1)

    formatted as d:hh:mm

    or for any period try this formula

    =NETWORKDAYS(A2,B2)-1-(MOD(B2,1)<MOD(A2,1))&" days "&TEXT(B2-A2,"hh:mm")

    the latter produces a text formatted result so that result is harder to use in any other calculation

    Note: I'm assuming that start and end times won't be at weekends, if they are then the above formulas may return incorrect results

    See attached examples where columns A and B contain random (weekday) date/times - press F9 to re-generate
    Attached Files Attached Files
    Audere est facere

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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