+ Reply to Thread
Results 1 to 16 of 16

How many Mondays, Tuesdays, etc. to date - AGAIN...

  1. #1
    Forum Contributor
    Join Date
    01-09-2009
    Location
    NJ/NY
    MS-Off Ver
    Excel 2007 & 2016
    Posts
    124

    How many Mondays, Tuesdays, etc. to date - AGAIN...

    I had received help with this in April 2015 (I wasn稚 able to implement this into production until March 2016, though), and thought I did everything correctly, but the Memorial Day holiday demonstrated that I知 missing something. I知 using Excel 2007, and I have a set of worksheets where I知 tracking how many patients were seen on each workday of the week. I create a new set of these sheets every month by changing a few of the cells. The sheet calculates how many workdays there are each month (N20:N24), year to date (O20:O24) and the total for the year (P20:P24). Year to date and total for the year are working correctly, but I see that the workdays per month are not looking at the table in S5:S10, which lists the five legal holidays the facility is closed. I壇 think that the formulae for the year to date could be used with beginning and end dates set for each month, but I知 not sure how to do this. The attached sheet contains no patient data, but does include all of the cells needed for date calculations. Would someone be able to help me with this?

    Thank you.
    Attached Files Attached Files
    Last edited by OverKnight; 05-31-2016 at 09:42 PM. Reason: typo...

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    Try

    =NETWORKDAYS.INTL($S$14,$S$15,1,$S$4:$S$10)

    will give number of workdays (Monday to Friday) in May allowing for holidays.

    Not available in Excel 2007 !

    Use ...


    =NETWORKDAYS($S$14,$S$15,$S$4:$S$10)

    Excludes weekends.
    Last edited by JohnTopley; 05-31-2016 at 01:09 PM.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    For the individual weekdays,

    =SUMPRODUCT(--(TEXT(ROW(INDIRECT(S14&":"&T14)),"ddd")="Mon"),--(ISERROR(MATCH(ROW(INDIRECT(S14&":"&T14)),S5:S10,0))))

  4. #4
    Forum Contributor
    Join Date
    01-09-2009
    Location
    NJ/NY
    MS-Off Ver
    Excel 2007 & 2016
    Posts
    124

    Re: How many Mondays, Tuesdays, etc. to date - AGAIN...

    Thank you, John. Possibly I wasn't clear in stating that what needs to be changed are the formulae in cells N20:N24. Your formula gives me the number of days worked year to date (which I'm already getting in O20:O24 from a much more complex formula than yours), not just in a specified month.
    Last edited by OverKnight; 05-31-2016 at 09:43 PM.

  5. #5
    Forum Contributor
    Join Date
    01-09-2009
    Location
    NJ/NY
    MS-Off Ver
    Excel 2007 & 2016
    Posts
    124

    Re: How many Mondays, Tuesdays, etc. to date - AGAIN...

    Thank you, Jason. Your formula appears to do the job. Thanks very much.
    Last edited by OverKnight; 05-31-2016 at 09:44 PM.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    Mine is actually is days worked in May (dates in S14/S15) i.e. N25 data

    Others ....

    O25 (Year to date)

    =NETWORKDAYS($S$17,TODAY(),$S$4:$S$10)

    Full year


    P25

    =NETWORKDAYS($S$17,S18,$S$4:$S$10)

    s17=01/01/2016
    s18=31/12/2016

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    I would also suggest using something similar in O20:O24, the existing formula is not accurate.

    =SUMPRODUCT(--(TEXT(ROW(INDIRECT(DATE(2016,1,1)&":"&T14)),"ddd")="Mon"),--(ISERROR(MATCH(ROW(INDIRECT(DATE(2016,1,1)&":"&T14)),S5:S10,0))))

    Possibly the formula in P20:P24 also suffers from inaccuracy, I haven't checked it thoroughly.

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    Just to clarify: the total number of Mondays worked in May should have been 4 since there are 5 Mondays in May, but one of them was a holiday. Is this correct?

    Column N is the number of a particular day of the week worked month to date.
    Column O is the number of a particular day of the week worked year to date.
    Column P is the number of a particular day of the week that exist for the year.

    All minus holidays.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  9. #9
    Forum Contributor
    Join Date
    01-09-2009
    Location
    NJ/NY
    MS-Off Ver
    Excel 2007 & 2016
    Posts
    124

    Re: How many Mondays, Tuesdays, etc. to date - AGAIN...

    Thank you, John, but when I enter =NETWORKDAYS($S$14,$S$15,$S$4:$S$10) into cells N20:N24, 21 is returned in every cell. As of May 31st, there have been 21 Mondays, Tuesdays, Wednesdays, Thursdays and Fridays in 2016, but the correct result for these cells should be 4. Could I have copied these incorrectly? I copied NETWORKDAYS($S$14,$S$15,$S$4:$S$10) into N20:N24, and then added the "=" to the beginning of each formula. Please know that I do appreciate your efforts.

    Thanks again, Jason. So far the data in O20:O24 and P20:P24 have been accurate, but I'll try your formula in these cells.
    Last edited by OverKnight; 05-31-2016 at 09:44 PM.

  10. #10
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    I found the error in O20 when I was testing the accuracy of my first suggestion in N20. I deleted the date in S6 to make sure that the formula updated as expected, and noticed that the formula in O20 didn't change from 21 to 22 as it should.

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    My formulae only provided the totals: Jason's provided the individual day counts (subject to his last posting!)

  12. #12
    Forum Contributor
    Join Date
    01-09-2009
    Location
    NJ/NY
    MS-Off Ver
    Excel 2007 & 2016
    Posts
    124

    Re: How many Mondays, Tuesdays, etc. to date - AGAIN...

    Dflak, you are correct. We're open every day except for weekends and legal US holidays, so in order to accurately see the patient volume for each weekday, we need to exclude the holidays. Columns N and O will change every day (unless there is a holiday), and column P shows how many workdays for each day of the week (48 Mondays, 52 Tuesdays, etc.) there will be for the entire calendar year. This sheet is updated on the following day, i.e., I'll enter Monday's volume data on Tuesday, Tuesdays on Wednesday, etc.; that is why N17, S4 and S28 add "-1" to the end of the TODAY() function.

    To further clarify this, I've attached another sheet that shows what the final report looks like. The data in cells A7:A15, B7:M16 and B20:M24 have either been removed or replaced with the reported values. I've entered Jason's formulae into cells N20:O24.

    Thank you, everyone, for your help.
    Attached Files Attached Files
    Last edited by OverKnight; 05-31-2016 at 09:45 PM.

  13. #13
    Forum Contributor
    Join Date
    01-09-2009
    Location
    NJ/NY
    MS-Off Ver
    Excel 2007 & 2016
    Posts
    124

    Re: How many Mondays, Tuesdays, etc. to date - AGAIN...

    Jason, 21 is the accurate number for the number of Mondays to date in 2016, not 22. What I find odd is when you delete 5/30/2016 from cell S6, a day is added to every day of the week (# of Workdays in May changes from 4 to 5 for every weekday, # of Workdays to Date changes from 21 to 22 for every workday, and # of Workdays in 2016 adds one to every weekday).
    Last edited by OverKnight; 05-31-2016 at 09:45 PM.

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    Workdays in month

    =SUMPRODUCT(--(TEXT(ROW(INDIRECT($S$14&":"&$S$15)),"ddd")="Mon"),--(ISERROR(MATCH(ROW(INDIRECT($S$14&":"&$S$15)),$S$4:$S$10,0))))

    Dates should be S14/S15 (???) not S14 / T14

    Holidays need absolute references.

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    If you delete 30/05/2016 it correctly adds 1 to Monday (all other days remain the same) for May

    In both formula in columns N & O the ddd references were NOT changed to Mon, Tue etc: ALL are Mon. Hence why all change when removing 30/05/2016 ( a Monday)!

  16. #16
    Forum Contributor
    Join Date
    01-09-2009
    Location
    NJ/NY
    MS-Off Ver
    Excel 2007 & 2016
    Posts
    124

    Re: How many Mondays, Tuesdays, ect. to date - AGAIN...

    I think I finally have it.
    John, thank you for catching "Mon" in O21:O24, where Tue, Wed, Thu and Fri should have been entered. Your formula, as above with the correct days of the week entered, returned 4 for Tuesdays in May 2016; it should be 5, with 4 the correct value for the rest of the days. I played around with it for a while, but with my meager abilities, I couldn't figure out how to make it work.
    This is the formula that is working: =SUMPRODUCT(--(TEXT(ROW(INDIRECT(S14&":"&T14)),"ddd")="Mon"),--(ISERROR(MATCH(ROW(INDIRECT(S14&":"&T14)),S5:S10,0)))).

    Thank you to everyone who helped.

+ 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. Number of Mondays (Tuesdays, etc.) in a month, not counting holidays
    By ratkins in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-24-2015, 04:12 PM
  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. [SOLVED] return weeknumber from date, but only on mondays
    By reluctant in forum Excel General
    Replies: 9
    Last Post: 10-12-2014, 04:29 AM
  4. Counting the number of Mondays between a start and end date
    By Phil_H in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-01-2009, 09:57 AM
  5. No. of Mondays in Date Range
    By john_mc in forum Excel General
    Replies: 4
    Last Post: 03-22-2007, 07:09 PM
  6. Get Mondays Date
    By mpeplow in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-14-2006, 01:19 PM
  7. [SOLVED] Date function: 1st, 3rd and 5th Mondays of a month
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-02-2005, 06:20 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