+ Reply to Thread
Results 1 to 8 of 8

Combining NETWORKDAYS.INTL with IF formula?

  1. #1
    Registered User
    Join Date
    02-11-2016
    Location
    Atlanta, GA
    MS-Off Ver
    MS Excel 2010
    Posts
    3

    Combining NETWORKDAYS.INTL with IF formula?

    I have several employees working in different countries (USA, UK, Germany) so each group has different holidays. I need to calculate how many days it takes to process the order excluding weekends and holidays. In the attached file I created a separate tab called “Holiday list” for each country and I have been using a working formula for each employee.

    Formula A: Anna & Karen work in USA so their formula is =NETWORKDAYS.INTL(B2,C2,1’Holiday list’!A2:A9)-1
    Formula B: Tami & Keith work in UK so their formula is =NETWORKDAYS.INTL(B2,C2,1’Holiday list’!B2:B8)-1
    Formula C: George & Andy work in Germany so their formula is =NETWORKDAYS.INTL(B2,C2,1’Holiday list’!C2:C18)-1

    Currently I have to change the formulas weekly based on the employee name (I have to filter based on their names and change manually) so I would like to combine these formulas into one. If column A2 equals Anna or Karen use formula A, if A2 equals Tami or Keith use formula B etc . I have tried nestled IF formulas but can’t get it working. Maybe something else is needed? Thank you.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Combining NETWORKDAYS.INTL with IF formula?

    Hi
    Use these
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    where 'Days in process'!$J$2:$K$7 is the information of the working country.

    See the file Days in process.xlsx

  3. #3
    Registered User
    Join Date
    02-11-2016
    Location
    Atlanta, GA
    MS-Off Ver
    MS Excel 2010
    Posts
    3

    Re: Combining NETWORKDAYS.INTL with IF formula?

    hmmm It's not working. I don't think it likes using the holiday list so yesterday I recreated the formulas for each country by manually retyping the holidays. How would you incorporate this?

    Tami & Keith UK formula: =NETWORKDAYS.INTL(B7,C7,1,{"2016/3/25","2016/3/28","2016/5/2","2016/5/30","2016/8/29","2016/12/26","2016/12/27"})-1
    Anna & Karen US formula: =NETWORKDAYS.INTL(B2,C2,1,{"2016/1/1","2016/5/30","2016/7/4","2016/9/5","2016/11/24","2016/11/25","2016/12/23","2016/12/26"})-1
    George & Andy Germany formula:=NETWORKDAYS.INTL(B9,C9,1,{"2016/1/1","2016/2/8","2016/2/9","2016/2/10","2016/3/25","2016/3/26","2016/3/28","2016/4/4","2016/5/2","2016/5/14","2016/6/9","2016/7/1","2016/9/16","2016/10/1","2016/10/10","2016/12/26","2016/12/27"})-1

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Combining NETWORKDAYS.INTL with IF formula?

    Jose's solution works well for me.

    Did you look at the book he attached?
    It includes a lookup table that you need to create that determines which region each name is in.

  5. #5
    Registered User
    Join Date
    02-11-2016
    Location
    Atlanta, GA
    MS-Off Ver
    MS Excel 2010
    Posts
    3

    Re: Combining NETWORKDAYS.INTL with IF formula?

    I didn’t realize there was a file. However it is not calculating the holidays like it should. I added -1 to formula because if order was processed on the same day the result should be 0. To test the holiday list I amended the dates in the row 12 for Andy. Since Germany has holiday on 2/8, 2/9, 2/10 the result should be 1 and it calculated 4. I also had a question about the formula. Should $C$17 be $C$18? I am stumped.

    =NETWORKDAYS.INTL(B2,C2,1,OFFSET('Holiday List'!$A$1:$C$17,1,MATCH(VLOOKUP(A2,'Days in process'!$J$2:$K$7,2,FALSE),'Holiday List'!$A$1:$C$1,0)))-1
    Attached Files Attached Files

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Combining NETWORKDAYS.INTL with IF formula?

    I added -1 to formula because if order was processed on the same day the result should be 0.
    OK but row 12 is not processed on the same day. Why are we subtracting 1 in those cases?

    I did not use OFFSET in this formula. While it returns what you indicate I am a bit confused about subtracting in the other cases.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit Also try subtracting 1 from the MATCH in the OFFSET formula

    =NETWORKDAYS.INTL(B2,C2,1,OFFSET('Holiday List'!$A$1:$C$18,1,MATCH(VLOOKUP(A2,'Days in process'!$J$2:$K$7,2,FALSE),'Holiday List'!$A$1:$C$1,0)-1))-1

    It will return the same numbers you are looking for now.
    Last edited by FlameRetired; 02-16-2016 at 12:02 AM. Reason: included formula / added comment
    Dave

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Combining NETWORKDAYS.INTL with IF formula?

    I get the need to subtract 1, because networkdays(a1,b1) is NOT exactly the same as B1-A1

    Networkdays is INCLUSIVE (it counts) BOTH Start and End Dates.
    While B1-A1 does Not.

    But You shouldn't subtract 1 from the result of networkdays to account for that.
    You can end up with erroneous results if the Start and/or End dates happen to fall on weekends or holidays.
    Instead, either Add 1 to the Start Date, OR Subtract 1 from the End Date.

    Add 1 to start date
    =IF(B2=C2,0,NETWORKDAYS(B2+1,C2,INDEX('Holiday List'!$A$2:$C$18,,MATCH(VLOOKUP(A2,$J$2:$K$7,2,0),'Holiday List'!$A$1:$C$1,0))))

    Subtract 1 from end date
    =IF(B2=C2,0,NETWORKDAYS(B2,C2-1,INDEX('Holiday List'!$A$2:$C$18,,MATCH(VLOOKUP(A2,$J$2:$K$7,2,0),'Holiday List'!$A$1:$C$1,0))))


    And I changed it to plain old Networkdays.
    You only need the .INTL version if you have something other than Sat/Sun weekends.
    Last edited by Jonmo1; 02-16-2016 at 09:51 AM.

  8. #8
    Registered User
    Join Date
    07-11-2016
    Location
    France
    MS-Off Ver
    2010
    Posts
    1

    Re: Combining NETWORKDAYS.INTL with IF formula?

    Hi all,

    I also have to calculate business days for depots KPIs. I have used the formula from Jose (adapted to my data) but it is not working. I get #NUM and # VALUE errors. I don't know if this comes from the cells format...
    I am wondering if you would accept to take a look at the file to perhaps identify where the issue comes from. Thanks a lot!

+ 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. [SOLVED] Networkdays.intl vs networkdays
    By shukla.ankur281190 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-30-2015, 08:39 AM
  2. NETWORKDAYS.INTL in 2007
    By nickh1981 in forum Excel General
    Replies: 4
    Last Post: 08-11-2015, 02:45 AM
  3. [SOLVED] Networkdays.intl
    By andrecamapum in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-30-2015, 09:31 AM
  4. Combining IF and NETWORKDAYS
    By Applemoose in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-06-2015, 05:57 AM
  5. [SOLVED] Networkdays.Intl, incorrect result in one row
    By razaas in forum Excel General
    Replies: 1
    Last Post: 10-22-2014, 07:04 AM
  6. [SOLVED] Looking for alternative to NETWORKDAYS.INTL
    By Jaron_t in forum Excel General
    Replies: 4
    Last Post: 05-21-2012, 04:54 PM
  7. combining NETWORKDAYS, TODAY() and division in a formula
    By scaffdog845 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-08-2008, 05:33 PM

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