+ Reply to Thread
Results 1 to 7 of 7

Number of Mondays (Tuesdays, etc.) in a month, not counting holidays

  1. #1
    Registered User
    Join Date
    02-14-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007 (home) & 2013 (work)
    Posts
    10

    Number of Mondays (Tuesdays, etc.) in a month, not counting holidays

    Hello, all.

    So I know how to count the number of workdays in a month:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And I know how to exclude holidays
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And I know how to count the number of Mondays, etc., in a month (where 1 = Monday, 2 is Tuesday, etc.):
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The following works, too, for Monday, but I have no idea what it's doing, and I don't know how to specify Tuesday, but it seems more desirable because it's less complicated and shorter:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    What I don't know is how to combine them and get the number of non-holiday Mondays, Tuesdays, etc., in a particular month.

    Help?

    Thanks.

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

    Re: Number of Mondays (Tuesdays, etc.) in a month, not counting holidays

    Can you confirm which version of Excel you are using - your profile says Excel 2003, is that right?

    It's easy with Excel 2010 or later, you can use NETWORKDAYS.INTL function, e.g. for Mondays

    =NETWORKDAYS.INTL(A1,EOMONTH(A1,0),"0111111",holidays)

    The "0111111" part gives you Mondays, change to "1011111" for Tuesdays, "1101111" for Wednesdays etc.

    In Excel 2003, assuming you have Analysis ToolPak enabled you can use this version to exclude holidays

    =SUMPRODUCT((WEEKDAY(ROW(INDIRECT(A1&":"&EOMONTH(A1,0))),2)=1)*ISNA(MATCH(ROW(INDIRECT(A1&":"&EOMONTH(A1,0))),holidays,0)))

    Where the 1 is for Mondays, 2 for Tuesdays etc.
    Last edited by daddylonglegs; 08-24-2015 at 02:53 PM.
    Audere est facere

  3. #3
    Registered User
    Join Date
    02-14-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007 (home) & 2013 (work)
    Posts
    10

    Re: Number of Mondays (Tuesdays, etc.) in a month, not counting holidays

    I'd be using Excel 2007 for this; I updated my profile.

    So is that 2nd formula a combination of the two Monday-counting formulas I posted? It seems to combine elements of both.

    I'll give it a try, but in the meantime, thanks!

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

    Re: Number of Mondays (Tuesdays, etc.) in a month, not counting holidays

    Quote Originally Posted by ratkins View Post
    So is that 2nd formula a combination of the two Monday-counting formulas I posted? It seems to combine elements of both.
    Yes, I rejigged it a little but this part.....

    ROW(INDIRECT(A1&":"&EOMONTH(A1,0)))

    creates an array of all dates in the month, and the WEEKDAY part tests those dates against the day of week and the ISNA(MATCH part tests the same array against the holiday range, SUMPRODUCT will count only those dates which are the correct weekday and aren't in the holiday range.

    I'm assuming that A1 date is always the first of the month as that seems to be the case for your formulas

    Edit: ....but I made a small error in the formula originally - the way I wrote it 1 would actually be equal to Sunday for the day check. I added ,2 to the WEEKDAY function to fix that - please use amended version
    Last edited by daddylonglegs; 08-24-2015 at 02:55 PM.

  5. #5
    Registered User
    Join Date
    02-14-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007 (home) & 2013 (work)
    Posts
    10

    Re: Number of Mondays (Tuesdays, etc.) in a month, not counting holidays

    That works! Thanks!


  6. #6
    Registered User
    Join Date
    02-14-2013
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2007 (home) & 2013 (work)
    Posts
    10

    Re: Number of Mondays (Tuesdays, etc.) in a month, not counting holidays

    By the way, do people not use the formula tag? I noticed that you have to be a registered user to see them...

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Number of Mondays (Tuesdays, etc.) in a month, not counting holidays

    Quote Originally Posted by ratkins View Post
    By the way, do people not use the formula tag?
    Some people do and some don't.

    I don't.

    I find them to be a PITA in that with longer formulas you have to scroll to see the formula and the entire formula will not be in full view.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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. Mondays to Fridays Grouped by Month, Excluding Holidays, Between Two Dates
    By brenden101 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-06-2015, 08:28 AM
  2. [SOLVED] How many Mondays, Tuesdays, etc. in 2015 to date?
    By OverKnight in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-20-2015, 01:53 PM
  3. Replies: 1
    Last Post: 12-12-2014, 05:43 PM
  4. [SOLVED] counting mondays of a month THEN subtracting monday's already past
    By bryan469 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-24-2014, 10:07 AM
  5. number of mondays in a month formula
    By TechRetard in forum Excel General
    Replies: 6
    Last Post: 12-01-2011, 04:09 PM
  6. Number of Mondays left in current month
    By JuJuBe in forum Excel General
    Replies: 3
    Last Post: 09-20-2010, 06:51 PM
  7. How do I calculate number of Mondays in a given month in Excel?
    By Rossta in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-26-2006, 11:07 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