+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: days within the month

  1. #1
    Registered User
    Join Date
    05-03-2011
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    45

    days within the month

    Hi
    Gurus

    Please advic eme how can i get the no of
    1.business days in a month and
    2.elapsed days

    where if i can fill in the holidays in another column

    referring to the holidays column i must be able to achive the above two

    thanks for your great help earlier and in advance

  2. #2
    Forum Guru jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2007
    Posts
    2,535

    Re: days within the month

    A1 = First Day of Month
    B1 = End of Month
    Holidays = Named Range

    =NETWORKDAYS(A1,B1,Holidays)
    HTH
    Regards, Jeff

    If you like the answer(s) provided, why not add some reputation by clicking the * below
    Please use [ Code ] tags when posting [ /Code ]
    Please view/read the Forum rules --- How to mark a thread as solved

  3. #3
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,052

    Re: days within the month

    If you want elapsed business days in the current month (including TODAY) try

    =NETWORKDAYS(EOMONTH(TODAY(),-1)+1,TODAY(),holidays)

    ......and total business days in the current month

    =NETWORKDAYS(EOMONTH(TODAY(),-1)+1,EOMONTH(TODAY(),0),holidays)
    Audere est facere

  4. #4
    Registered User
    Join Date
    05-03-2011
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: days within the month

    Hi thanks for the repsonse

    but my requirement is to find the no of business days in the particular month only.
    sorry i was not specific in mypost

    it should be based on the month drop down selected
    if the the user selects may then it must show
    1.the number of business days in the may month
    2. and if the previous month selected for example may then the elapsed days will be equal to the business days in the may month
    3. if june is selected then assuming that today is the 29th june
    a. business days must be 22
    b. elapsed days must be 21
    4. if may is selected when the current month is june , then it must never show the days in june but must show only may month business days

    hope it is not confusing

    thanks

  5. #5
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,052

    Re: days within the month

    So what exactly does the dropdown show? A date? just a month like "December" or a month and year......
    Audere est facere

  6. #6
    Registered User
    Join Date
    05-03-2011
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: days within the month

    Quote Originally Posted by daddylonglegs View Post
    So what exactly does the dropdown show? A date? just a month like "December" or a month and year......

    there are three drop downs which are necessary for my kind of report where the user must be able to choose all the three seperately

    drop down with a year 2011
    drop down with a month APR
    drop down with a day 01



    thanks

  7. #7
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,052

    Re: days within the month

    Assuming A1 is year, B1 is month and C1 is day then to get total business days in that whole month try this formula

    =NETWORKDAYS(EOMONTH(C1&B1&A1,-1),EOMONTH(C1&B1&A1,0),holidays)

    I'm not sure what you want for elapsed days. What if 4th Jun 2011 is selected - do you want business days from then to now? (or will the day only be 1)?

    What about previous dates (or future dates)?
    Audere est facere

  8. #8
    Registered User
    Join Date
    05-03-2011
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: days within the month

    Quote Originally Posted by daddylonglegs View Post
    Assuming A1 is year, B1 is month and C1 is day then to get total business days in that whole month try this formula

    =NETWORKDAYS(EOMONTH(C1&B1&A1,-1),EOMONTH(C1&B1&A1,0),holidays)

    I'm not sure what you want for elapsed days. What if 4th Jun 2011 is selected - do you want business days from then to now? (or will the day only be 1)?

    What about previous dates (or future dates)?
    if june 4th is selected
    since today is june 30th
    the number of elapsed days will be aall the business days from 4th june to 29th june that is excluding today() which will be total elapsed days 18

    thanks

  9. #9
    Registered User
    Join Date
    05-03-2011
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: days within the month

    Quote Originally Posted by daddylonglegs View Post
    Assuming A1 is year, B1 is month and C1 is day then to get total business days in that whole month try this formula

    =NETWORKDAYS(EOMONTH(C1&B1&A1,-1),EOMONTH(C1&B1&A1,0),holidays)

    I'm not sure what you want for elapsed days. What if 4th Jun 2011 is selected - do you want business days from then to now? (or will the day only be 1)?

    What about previous dates (or future dates)?
    when i try the above formula for no of bus days in the month say for example APR
    we have 21 working days but withthe formula i am getting 22 working days

    please advice

  10. #10
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,052

    Re: days within the month

    Sorry - I missed out a +1 which means that the count included the last day of the previous month - should be

    =NETWORKDAYS(EOMONTH(C1&B1&A1,-1)+1,EOMONTH(C1&B1&A1,0),holidays)

    and for elapsed days

    =MAX(0,NETWORKDAYS(MAX(C1&B1&A1,EOMONTH(TODAY(),-1)+1),TODAY()-1,holidays))
    Last edited by daddylonglegs; 06-30-2011 at 05:48 PM.
    Audere est facere

  11. #11
    Registered User
    Join Date
    05-03-2011
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: days within the month

    Quote Originally Posted by daddylonglegs View Post
    Sorry - I missed out a +1 which means that the count included the last day of the previous month - should be

    =NETWORKDAYS(EOMONTH(C1&B1&A1,-1)+1,EOMONTH(C1&B1&A1,0),holidays)

    and for elapsed days

    =MAX(0,NETWORKDAYS(MAX(C1&B1&A1,EOMONTH(TODAY(),-1)+1),TODAY()-1,holidays))
    I donot want the holidays to be considered
    if we donot consider the holidays
    my formula would be
    MAX(0,NETWORKDAYS(MAX($AL$64&$AL$63&$AL$62,EOMONTH(TODAY(),-1)+1),TODAY()-1))

    but the result for the month of june is 18 days

    am i doing something wrong ?

    the earlier formula for no of business days in a month works perfectly

    thanks

  12. #12
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,052

    Re: days within the month

    Are you saying that you get 18 when you shouldn't or you want to get 18 and you don't? For which dates, what's in $AL$64, and $AL$63 and $AL$62?
    Audere est facere

  13. #13
    Registered User
    Join Date
    05-03-2011
    Location
    usa
    MS-Off Ver
    Excel 2007
    Posts
    45

    Re: days within the month

    Quote Originally Posted by daddylonglegs View Post
    Are you saying that you get 18 when you shouldn't or you want to get 18 and you don't? For which dates, what's in $AL$64, and $AL$63 and $AL$62?

    the formula to calculate elapsed days (not counting today) is
    MAX(0,NETWORKDAYS(MAX(C1&B1&A1,EOMONTH(TODAY(),-1)+1),TODAY()-1))

    results only 18 for the month of jun

    which should actually result as 21 if not counting today
    it should result in 21 days
    sorry if my question was not clear in the previous post

    thanks

  14. #14
    Valued Forum Contributor Haseeb A's Avatar
    Join Date
    05-24-2011
    Location
    India | Kwt
    MS-Off Ver
    2007
    Posts
    1,447

    Re: days within the month

    Try this,

    Delete the C1 (Day) in MAX formula & just keep B1&A1 (Month&Year),

    MAX(0,NETWORKDAYS(MAX(B1&A1,EOMONTH(TODAY(),-1)+1),TODAY()-1))

    You are on safe hands with DLL, wait for his response.
    HTH; Haseeb

    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Forum Rules & How to Mark a thread as SOLVED

  15. #15
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,052

    Re: days within the month

    Quote Originally Posted by APPLEBEE View Post
    if june 4th is selected
    since today is june 30th
    the number of elapsed days will be aall the business days from 4th june to 29th june that is excluding today() which will be total elapsed days 18

    thanks
    Given the above doesn't that formula work correctly? If I use this formula

    =MAX(0,NETWORKDAYS(MAX(C1&B1&A1,EOMONTH(TODAY(),-1)+1),TODAY()-1))

    where today is 30th June, A1 = 2011, B1 = June (or Jun) and C1 = 4 then I get 18 as requested. If I change the 4 to a 1 I get 21 as expected. If I use any date earlier than 1st June then I still get 21.

    Can you confirm

    a) if that's what you want
    b) if that's what you get

    Thanks
    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)

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.2.0