+ Reply to Thread
Results 1 to 7 of 7

Mondays to Fridays Grouped by Month, Excluding Holidays, Between Two Dates

  1. #1
    Registered User
    Join Date
    02-23-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    5

    Mondays to Fridays Grouped by Month, Excluding Holidays, Between Two Dates

    Hi Excel Forum,

    As you can see by the description of this thread, I'm in need of a tricky excel formula.

    I would like to work out the number of weekdays (Mondays to Fridays), grouped in each month (January to December), excluding holidays.
    The values should be calculated from two dates e.g 02/05/2015 - 29/06/2015

    Perhaps the following table will give a bit more insight:

    Monday Tuesday Wednesday Thursday Friday
    2015 January
    2015 February
    2015 March
    2015 April
    2015 May
    2015 June
    2015 July
    2015 August
    2015 September
    2015 October
    2015 November
    2015 December

    I've attached an Excel Workbook with an example and the holidays date range.
    Workdays, in months, excluding holidays, between two dates.xlsx

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,101

    Re: Mondays to Fridays Grouped by Month, Excluding Holidays, Between Two Dates

    I had to rearrange your Table a bit to make it fit with your request. Does this look OK? These are array formulae. They are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...

    Sorry - I finally understood what you were after... this answer split by months as well. I'm not sure about that...
    Last edited by Glenn Kennedy; 07-06-2015 at 06:41 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    02-23-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    5

    Re: Mondays to Fridays Grouped by Month, Excluding Holidays, Between Two Dates

    Hi Glenn,

    Thank you for the reply. I appreciate the attempted help.

    This formula got a bit complicated for me too when I had to start grouping it by months.
    I tried using a PivotTable to produce the results, but to no avail.

    I've searched the internet high and low for this answer, hopefully somebody else may be able to help.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Mondays to Fridays Grouped by Month, Excluding Holidays, Between Two Dates

    See the attached file
    Try the below array formula in C2 and copy across
    =SUMPRODUCT((TEXT(DATE(2015,1,1)+ROW($1:$365)-1,"MMMM")=$B2)*(TEXT(DATE(2015,1,1)+ROW($1:$365)-1,"DDDD")=C$1)*(MMULT((DATE(2015,1,1)+ROW($1:$365)-1>=TRANSPOSE($A$16:$A$21))*(DATE(2015,1,1)+ROW($1:$365)-1<=TRANSPOSE($B$16:$B$21))*1,ROW($A$16:$A$21))>0)*(MMULT((DATE(2015,1,1)+ROW($1:$365)-1<>TRANSPOSE($A$24:$A$35+0))*1,(ROW($A$24:$A$35)>0)*1)=COUNTA($A$24:$A$35)))
    Please Login or Register  to view this content.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Registered User
    Join Date
    02-23-2015
    Location
    South Africa
    MS-Off Ver
    2013
    Posts
    5

    Re: Mondays to Fridays Grouped by Month, Excluding Holidays, Between Two Dates

    Quote Originally Posted by nflsales View Post
    See the attached file
    Try the below array formula in C2 and copy across
    =SUMPRODUCT((TEXT(DATE(2015,1,1)+ROW($1:$365)-1,"MMMM")=$B2)*(TEXT(DATE(2015,1,1)+ROW($1:$365)-1,"DDDD")=C$1)*(MMULT((DATE(2015,1,1)+ROW($1:$365)-1>=TRANSPOSE($A$16:$A$21))*(DATE(2015,1,1)+ROW($1:$365)-1<=TRANSPOSE($B$16:$B$21))*1,ROW($A$16:$A$21))>0)*(MMULT((DATE(2015,1,1)+ROW($1:$365)-1<>TRANSPOSE($A$24:$A$35+0))*1,(ROW($A$24:$A$35)>0)*1)=COUNTA($A$24:$A$35)))
    Please Login or Register  to view this content.
    Hi NFLSales,

    I am really impressed with the above formula. Repped!

    However, I see that the formula does not work when trying to use it on a range that spans from 2014 to 2015 (should probably have mentioned it, sorry).

    How would I adapt the formula to work with dates such as 26/12/2014 - 13/01/2015?

    Regards.

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

    Re: Mondays to Fridays Grouped by Month, Excluding Holidays, Between Two Dates

    You could use this array formula in C2

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Confirmed with CTRL+SHIFT+ENTER and copied across and down, this will work even if the date ranges are not wholly within 2015
    Audere est facere

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Mondays to Fridays Grouped by Month, Excluding Holidays, Between Two Dates

    See the attached file

+ 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. Replies: 3
    Last Post: 05-14-2015, 11:28 AM
  2. [SOLVED] Calculate End Date by excluding Fridays,Saturdays & Holidays
    By nawas in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-03-2013, 02:18 AM
  3. Replies: 2
    Last Post: 02-28-2013, 04:24 AM
  4. Return the dates of all the mondays and fridays in a month
    By all4excel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-28-2007, 07:20 AM
  5. Generating business days in a calendar month, EXCLUDING holidays
    By jacob in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-12-2005, 12:06 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