+ Reply to Thread
Results 1 to 12 of 12

Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Hi

    I need to calculate the difference between 2 dates to prove that my team is meeting agreed timescales for producing work.

    My current method of working out the timescale is to use the following formula (Column F is 'Date Email Request Received' and Column G is 'Date Quote Sent')

    =IF(F5>G5,0,IF(G5-F5=0,0,G5-F5))

    The formula removes incorrectly input data where the quote was sent before the request was received.

    My problem is that the above formula does not take into account Weekdays and if I use the NETWORKDAYS function then it rounds the time between the 2 dates.

    Any help to resolve this would be gratefully received!!

    Thanks

    James

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

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Hi jamesbaker1979

    Not sure if I follow you!
    =IF(G5<F5,0,NETWORKDAYS(F5,G5))
    Regards Kevin


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

  3. #3
    Registered User
    Join Date
    04-29-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Hi Kevin

    Using the example of quote coming in at 26/04/2013 16:00 and being sent out on 29/04/2013 10:00

    The turnaround time using the above formula returns a value of 2.00

    Using the original formula it returns 2.75

    The actual turnaround time should be 0.75 (excluding weekends)

    However if I could turn that into working time between 08:00 and 17:00 then the value should be 0.33 (3 hours work in a 9 hour working day).

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

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Hi jamesbaker1979

    Do you mean the business hours!

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-29-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Hi Kevin

    This works to a point.

    However, I think that the median function skews the results.

    For example

    Date quote comes in 19/12/2012 13:09
    Date quote sent out 03/01/2013 11:13

    The above formula produces a figure of 3.67

    The actual figure should be around 8.5 working days...

  6. #6
    Registered User
    Join Date
    04-29-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Hi Kevin

    I have just been messing around with that formula...I think if it is revised to

    =((NETWORKDAYS(F4,G4,Sheet1!$B$5:$B$12)-1)+IF(NETWORKDAYS(G4,G4,Sheet1!$B$5:$B$12),MEDIAN(MOD(G4,1),"17:00","08:00"),"17:00")-MEDIAN(MOD(F4,1),"17:00","08:00"))

    i.e. removing the *("17:00"-"08:00") against the networkdays then it produces something in the correct ballpark.

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

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Hi jamesbaker1979

    For that example you will have to put your holidays in the NETWORKDAYS, it is the third part of the function.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    EDIT: Format cells as [h]:mm. Remember this is business hrs, you will need to divide by 8/24 to ge the days and time.

    NETWORKDAYS
    Last edited by Kevin UK; 04-29-2013 at 06:07 AM.

  8. #8
    Registered User
    Join Date
    04-29-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    I have put holidays into the formula and that bit works.

    The formula still doesn't work exactly though

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

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Hi jamesbaker1979

    Remember this is total business hours. For your example in post #5 I get 70:04 business hours, If you divide this by 8/24 = 8.75833 (days)

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

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Quote Originally Posted by jamesbaker1979 View Post

    Date quote comes in 19/12/2012 13:09
    Date quote sent out 03/01/2013 11:13

    The above formula produces a figure of 3.67

    The actual figure should be around 8.5 working days...
    How do you get 8.5 working days, which days are holidays?

    If the start and end date/times are always within working hours then this version should be sufficient to get elapsed working days as a decimal

    =NETWORKDAYS(F4,G4,Sheet1!B$5:B$12)-1+(MOD(G4,1)-MOD(F4,1))*24/9
    Audere est facere

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

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    @ daddylonglegs

    My fault, 8/24 = 8.75833 (days). Should be 9/24 = 7.785185185 (08:00-17:00) not 09:00-17:00!

  12. #12
    Registered User
    Join Date
    04-29-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Calculate the difference between 2 working days - NETWORKDAYS does not work exactly

    Thanks for your help.

+ 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