+ Reply to Thread
Results 1 to 5 of 5

Number of times a month/day falls on a certain day-of-week within a range of years

  1. #1
    Forum Contributor
    Join Date
    06-12-2020
    Location
    USA
    MS-Off Ver
    2013
    Posts
    132

    Number of times a month/day falls on a certain day-of-week within a range of years

    Hello. I need a formula that will give me the number of times a specific date within a date range falls on a specific day of the week. In my attached example, it's how many times does June 5 occur on a Friday between the two dates. Also as an aside, how do you input a month and day without a year? Excel automatically adds the year 2020.
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Number of times a month/day falls on a certain day-of-week within a range of years

    Please try

    =SUMPRODUCT(--(TEXT(ROW(INDEX(A:A,A2):INDEX(A:A,C2)),"dddd d mmm")=H2&TEXT(E2," d mmm")))

    '05-Jun add a single quote to force date to text
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    06-12-2020
    Location
    USA
    MS-Off Ver
    2013
    Posts
    132

    Re: Number of times a month/day falls on a certain day-of-week within a range of years

    This works. Thanks! A couple of related questions.

    1. Same as above but how to exclude start and end dates?

    2. How can I convert a day of the week to a WORKDAY value? For example convert Monday to the number 2.

    3. How can I get all the dates that the month/day/day of week combo fall on?
    Last edited by bird333; 12-20-2020 at 11:47 AM.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Number of times a month/day falls on a certain day-of-week within a range of years

    1. J2
    =SUMPRODUCT(--(TEXT(ROW(INDEX(A:A,A2+1):INDEX(A:A,C2-1)),"dddd d mmm")=H2&TEXT(E2," d mmm")))

    2. H3
    =MATCH(H2,INDEX(TEXT(ROW(A$1:A$7),"dddd"),),)

    3. K2 Custom format to dddd d mmm yyyy
    =IFERROR(AGGREGATE(15,6,ROW(INDEX(A:A,A$2+1):INDEX(A:A,C$2-1))/(TEXT(ROW(INDEX(A:A,A$2+1):INDEX(A:A,C$2-1)),"dddd d mmm")=H$2&TEXT(E$2," d mmm")),ROWS(K$2:K2)),"")
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-12-2020
    Location
    USA
    MS-Off Ver
    2013
    Posts
    132

    Re: Number of times a month/day falls on a certain day-of-week within a range of years

    Thanks again. Can you explain how the formula in 3 works?

+ 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] Need Formula IF a MONTH & DAY falls in a Specific Week (or between 2 dates)
    By Pooger in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2020, 08:55 PM
  2. [SOLVED] how to get week number from date range of the month
    By leakhna in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-12-2018, 12:39 AM
  3. Week number in month determined by 3/4 weekdays in week within said month
    By atearth in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2017, 02:36 PM
  4. [SOLVED] Calculate Week Range from Week Number, Month and Year?
    By A108A108 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 05-07-2016, 03:11 PM
  5. Determine if a month falls between two dates - YEARS OVERLAPPING
    By eekbubble in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-18-2015, 12:03 PM
  6. Replies: 1
    Last Post: 07-21-2014, 06:13 PM
  7. Replies: 1
    Last Post: 06-03-2014, 06:31 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