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.
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.
Great. It works... Thanks a lot :-)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks