Counting Specific Days in Specific Month between Two Dates

samlions

New Member
Joined
Mar 5, 2014
Messages
5
Hi,

I'm trying to determine a formula that could be used to calculate the the number of specific days (i.e Mondays, Tuesdays) in each month (i.e January, February) using a date range. The date range will always be within the same year. The table that I have been trying to code (without macros) is shown below.

Would appreciate any assistance.

Many thanks,
Sam

Start Date
End Date
20/01/2014 20/04/2014
MondayTuesdayWednesdayThursdayFriday
January
=? i.e Count the number of Mondays in January within the date range above
February
March
April
May
June
July
August
September
October
November
December

<tbody>
</tbody>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
would you consider to construct a helper table and do your summary by using Pivot Table?
 
Upvote 0
Assume
A3 = Start Date
B3 = End Data

In the first cell that inter-crosses January and Monday,
=IF(AND(ROWS($A$1:$A1)<=MONTH($B$3),ROWS($A$1:$A1)>=MONTH($A$3)),SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(MAX(VALUE($A$3),DATE(YEAR($A$3),ROWS($A$1:$A1),1))&":"&MIN(VALUE($B$3),EOMONTH(DATE(YEAR($A$3),ROWS($A$1:$A1),1),0)))),2)=COLUMNS($A$1:A$1))),"")

Copy the formula down and across to fill up the table.

This works as long as start and end dates fall into same year.
 
Upvote 0
Hi,

I'm trying to determine a formula that could be used to calculate the the number of specific days (i.e Mondays, Tuesdays) in each month (i.e January, February) using a date range. The date range will always be within the same year. The table that I have been trying to code (without macros) is shown below.

Would appreciate any assistance.

Many thanks,
Sam

Start Date
End Date
20/01/2014 20/04/2014
MondayTuesdayWednesdayThursdayFriday
January
=? i.e Count the number of Mondays in January within the date range above
February
March
April
May
June
July
August
September
October
November
December

<tbody>
</tbody>

A2: 20-Jan-14
B2: 20-Apr-14

B5, copied across and down:

=SUMPRODUCT((TEXT(ROW(INDIRECT($A$2&":"&$B$2)),"ddddmmmm")=B$4&$A5)+0)
 
Upvote 0
A big thanks to mfexcel and Aladin Akyurek for your replies. Both answers were very helpful and much appreciated. Cheers!
 
Upvote 0

Forum statistics

Threads
1,214,885
Messages
6,122,090
Members
449,065
Latest member
Danger_SF

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top