I am trying to create a macro that will sort and count the number of weekdays in a year, such as follows:
I want to be able to automatically count how many Mon., Tue., etc. in the year.![]()
Please Login or Register to view this content.
I am trying to create a macro that will sort and count the number of weekdays in a year, such as follows:
I want to be able to automatically count how many Mon., Tue., etc. in the year.![]()
Please Login or Register to view this content.
Last edited by JBeaucaire; 01-07-2015 at 03:20 PM.
Assuming you had START and END dates for the range you wanted to "test" for Mondays in A1 and A2, this formula would give you a count of Mondays in that date range:
=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)))=2))
You should be able to adapt that to the dates you want and the days of the week needed in each cell you create a formula for in your table.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Thank you, I will definitely try that.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks