+ Reply to Thread
Results 1 to 6 of 6

NETWORK DATES, Dates and Times Working In Unison...

  1. #1
    Registered User
    Join Date
    04-14-2015
    Location
    Lincoln, UK
    MS-Off Ver
    2013
    Posts
    37

    NETWORK DATES, Dates and Times Working In Unison...

    Hi All -

    I am currently trying to work a formula that will total NETWORK DAYS between 2 dates, but also discount hours off either of the two 'bookend' dates if it is a half-day / quarter-day or whatever (this ties in with HR payroll, hence why it has to be specific. I just can't get the formula right to correctly total 2 full days, a portion of a day and a full day (or a full day and the latter bookend be a portion of a day) or both bookend days be portions of a day.

    My formula is

    =IF(ISNUMBER(O3),NETWORKDAYS(E3,O3,BankHols18)-(IF(K3<=1,K3,0))-(IF(U3<=1,U3,0)),K3)

    i.e. if a second date is given in O3, (therefore a 'range' / bookends, rather than a single day), calc. the network days between start and finish dates, BUT if the first or last day are less than 1.00 of a day (decimals and time play into this so a bit of a pain!!) discount this off the total amount. It has to allow for either the first or last day not being a full day. Sometimes I can get it work with one but not the other!!!

    Any help appreciated. I have tried both 'IF' and 'SUMIF' but not sure which is better for this?

    I have attached the sheet. I have working on it a while so maybe I'm missing something obvious!!

    Thanks,

    Stuart
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-14-2015
    Location
    Lincoln, UK
    MS-Off Ver
    2013
    Posts
    37

    Re: NETWORK DATES, Dates and Times Working In Unison...

    It is cell W3 specifically FYI.

    It asks for a password due a missing tab but this can be ignored i think

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: NETWORK DATES, Dates and Times Working In Unison...

    Your formula is:
    =IF(ISNUMBER(O3),NETWORKDAYS(E3,O3,BankHols18)-(IF(K3<=1,K3,0))-(IF(U3<=1,U3,0)),K3)

    If you replace the red part with the blue one below it will return correct data
    =IFERROR(IF(ISNUMBER(O3),NETWORKDAYS(E3,O3,BankHols18)-(IF(K3<1,K3,0))-(IF(IFERROR((T3/8),""),U3,0))),"")

  4. #4
    Registered User
    Join Date
    04-14-2015
    Location
    Lincoln, UK
    MS-Off Ver
    2013
    Posts
    37

    Re: NETWORK DATES, Dates and Times Working In Unison...

    Thanks Paul -

    It still returns 3.5 Days? It should return 4.5 Days as follows:

    Network Days Between Mon. 4th June and Fri. 8th June = 5 WORKING DAYS

    MONDAY 4th JUNE
    4 H ABSENCE = 0.5 of Working Day (as shown in Col. K) (8 hours = full working day), so it needs to discount 4 hours (0.5 Day) from the 5 working days = 4.5 Days.

    Hope that makes sense!

    Thanks,

    Stuart

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,625

    Re: NETWORK DATES, Dates and Times Working In Unison...

    Try this
    Please Login or Register  to view this content.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  6. #6
    Registered User
    Join Date
    04-14-2015
    Location
    Lincoln, UK
    MS-Off Ver
    2013
    Posts
    37

    Re: NETWORK DATES, Dates and Times Working In Unison...

    Thanks for the revised code, I'll give it a whirl shortly

    Thanks,

    Stuart

+ 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. Calculate working hours between two dates/times
    By Drscott21 in forum Excel General
    Replies: 2
    Last Post: 04-03-2018, 12:55 PM
  2. Working with Dates and Times
    By Trojnfn in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-11-2015, 05:00 PM
  3. [SOLVED] Display Qty per Minute (Working with Dates & Times)
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2013, 06:33 PM
  4. Calculating working hours between two dates/times!
    By JDGreen17 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-22-2013, 07:46 AM
  5. Working with negative dates and times
    By mrteater in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-27-2013, 11:54 AM
  6. [SOLVED] working out lead times with 2 dates
    By NinjaBear in forum Excel General
    Replies: 2
    Last Post: 07-02-2012, 05:04 AM
  7. Working with dates and times in excel
    By skatmandu2002 in forum Excel General
    Replies: 2
    Last Post: 05-05-2008, 06:58 AM

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