+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Valued Forum Contributor
    Join Date
    11-02-2007
    Location
    Bryne, Norway
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    210

    Count daynames in a defined week

    I use the function below to count all days equal to monday in a range of dates, but I want to extend this function to count only mondays with weeknumber 11 as an example. I am aware of the WEEKNUM-function, but it will not work together with SUMPRODUCT because one can not use WEEKNUM on arrays.


    Code:
    =SUMPRODUCT(--(WEEKDAY(range)=2))

    This is a link to my question about counting daynames.

    http://www.excelforum.com/excel-gene...-equal-to.html
    Last edited by mkvassh; 03-19-2010 at 06:31 AM.

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,139

    Re: Count daynames in a defined week

    Try, perhaps:

    Code:
    =SUMPRODUCT(--(WEEKDAY(range)=2),--(1+INT((range-DATE(YEAR(range+4-WEEKDAY(range+6)),1,5)+WEEKDAY(DATE(YEAR(range+4-WEEKDAY(range+6)),1,3)))/7)=11))
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Valued Forum Contributor
    Join Date
    11-02-2007
    Location
    Bryne, Norway
    MS-Off Ver
    Microsoft Office Excel 2003
    Posts
    210

    Re: Count daynames in a defined week

    Great. It works... Thanks a lot :-)

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