+ Reply to Thread
Results 1 to 20 of 20

Networkdays formula - need help

  1. #1
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Networkdays formula - need help

    Hi,

    I have dates in column A, from 1st January to 31th December (A1:A365).

    I want to get Networkdays for each month, but not just with simple determining ranges for each month. What I want is that formula
    would check start day and end day of month, and then calculate Networkdays. This is because I have sheets with different years, and
    changing formula in each sheets would take me ages.

    This is what I got so far :

    Please Login or Register  to view this content.
    Formula is set for January, and result is 22 which is wrong, 21 is correct result because 1 day of holiday is between.

    Anybody have an idea how to fix this ??

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Networkdays formula - need help

    Formula will return 21 days when you add your holiday list of dates.

    =NETWORKDAYS(A1,B1,"1/1/2015")

    Data Range
    A
    B
    C
    1
    1/1/2015
    1/31/2015
    21
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Networkdays formula - need help

    looks like you didn't read my post#1....

    I know that, but I want formula to find start/end of month on its own. I have all dates in column A, not separated. List of holidays with dates was allready created before...

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

    Re: Networkdays formula - need help

    If A1 is the Year and A2 is the Month Number, try

    =NETWORKDAYS(DATE(A1,A2,1),DATE(A1,A2+1,0),Holidays)

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Networkdays formula - need help

    Ok, I see what you meen (I think)

    the start date

    =MIN(IF(MONTH(A2:A24)=1,A2:A24))

    end date

    =Max(IF(MONTH(A2:A24)=1,A2:A24))

    both formulas array entered.

  6. #6
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Networkdays formula - need help

    Hi Jonmo1,

    As I told I have dates in column A - like this:

    01.01.2015
    02.01.2015
    03.01.2015 etc.

    I formatted A1 as "yyyy" to show year, and A2 as "mm" to show month number....And tried your formula, but not working, I get #Num error

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

    Re: Networkdays formula - need help

    Can you post a sample book

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Networkdays formula - need help

    This array formula will return the number of days (21 for january)

    where "1/1/2015" is a holiday

    =NETWORKDAYS(MIN(IF(MONTH(A2:A24)=1,A2:A24)),MAX(IF(MONTH(A2:A24)=1,A2:A24)),"1/1/2015")

    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER

  9. #9
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Networkdays formula - need help

    ok, but only dates, nothing else...
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Networkdays formula - need help

    Hi Alkey,

    Don't quite follow your fomula but on first sight I would say that you determine a range for month to check. It must check all dates in range A1:A365, including Feb, March etc. Your formula produces me a result of 16.

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

    Re: Networkdays formula - need help

    Can you include what your expected result is?

    It's unclear exactly what you want to happen.

  12. #12
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Networkdays formula - need help

    1st January is holiday, ofcourse. January has 31 days, and 21 working days. It's just that what I want - and for all other months ofcourse (formula will determine what is holiday).

    Problem is that dates all together in one column, you see that in sample. I can't change that. And sheets are made for years 2000-2020, so I would need to create many different formulas for each sheet.

  13. #13
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Networkdays formula - need help

    1st January is holiday, ofcourse. January has 31 days, and 21 working days. It's just that what I want - and for all other months ofcourse (formula will determine what is holiday).

    Problem is that dates all together in one column, you see that in sample. I can't change that. And sheets are made for years 2000-2020, so I would need to create many different formulas for each sheet.

  14. #14
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Networkdays formula - need help

    Quote Originally Posted by Lukael View Post
    Hi Alkey,

    Don't quite follow your fomula but on first sight I would say that you determine a range for month to check. It must check all dates in range A1:A365, including Feb, March etc. Your formula produces me a result of 16.
    Did you change ranges? You need to change A2:A24 to A1:A365

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

    Re: Networkdays formula - need help

    Unfortunately, You have to specify the Holidays.
    There's no built in function to tell Excel which days are holidays.
    Simply because the definition of Holiday varies so much from city to state to country, and not even all businesses recongnize the same holidays.
    So you have to create your own range of cells that contain designated holiday dates to exclude.

    So this would do January, based on the year given in A1
    =NETWORKDAYS(DATE(YEAR($A$1),1,1),EOMONTH(DATE(YEAR($A$1),1,1),0),$M$1:$M$20)

    The Red 1's are what you have to change for each month
    M1:M20 is the range containing your list of holiday dates (you can put it anywhere you want).

  16. #16
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Networkdays formula - need help

    Did you change ranges? You need to change A2:A24 to A1:A365

    yes i did that too

  17. #17
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Networkdays formula - need help

    Unfortunately, You have to specify the Holidays.
    There's no built in function to tell Excel which days are holidays.
    Simply because the definition of Holiday varies so much from city to state to country, and not even all businesses recongnize the same holidays.
    So you have to create your own range of cells that contain designated holiday dates to exclude.

    So this would do January, based on the year given in A1
    =NETWORKDAYS(DATE(YEAR($A$1),1,1),EOMONTH(DATE(YEAR($A$1),1,1),0),$M$1:$M$20)

    The Red 1's are what you have to change for each month
    M1:M20 is the range (you can put it anywhere you want) containing your list of holiday dates.
    I'm sorry, but I still get result 22. See attached sample !
    Attached Files Attached Files

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

    Re: Networkdays formula - need help

    You didn't change the range for the holidays.
    The formula still references M1:M20, but you put the holiday dates in M316:M328

  19. #19
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Networkdays formula - need help

    oh my god, sorryyyyy... I really didn't notice that. It works, finally !! thanks a lot !!!

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

    Re: Networkdays formula - need help

    You're welcome.

+ 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 formula
    By Lukael in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-27-2014, 03:47 PM
  2. [SOLVED] Networkdays formula
    By gtudor in forum Excel General
    Replies: 14
    Last Post: 05-03-2012, 10:49 AM
  3. NETWORKDAYS formula
    By TMC in forum Excel General
    Replies: 6
    Last Post: 02-09-2008, 11:53 AM
  4. [SOLVED] NETWORKDAYS FORMULA
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  5. [SOLVED] NETWORKDAYS FORMULA
    By Lichase in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  6. NETWORKDAYS FORMULA
    By Lichase in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. [SOLVED] NETWORKDAYS FORMULA
    By Lichase in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  8. [SOLVED] NETWORKDAYS FORMULA
    By Lichase in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-09-2005, 05:05 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