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>
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

mfexcel

Well-known Member
Joined
Jan 8, 2009
Messages
791
would you consider to construct a helper table and do your summary by using Pivot Table?
 

mfexcel

Well-known Member
Joined
Jan 8, 2009
Messages
791
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.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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)
 

mfexcel

Well-known Member
Joined
Jan 8, 2009
Messages
791

ADVERTISEMENT

You are genius! Impressive!:pray::pray:


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)
 

samlions

New Member
Joined
Mar 5, 2014
Messages
5
A big thanks to mfexcel and Aladin Akyurek for your replies. Both answers were very helpful and much appreciated. Cheers!
 

Watch MrExcel Video

Forum statistics

Threads
1,122,912
Messages
5,598,828
Members
414,260
Latest member
joishe

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
Top