Counting dates to the month

searchingforhelp

Board Regular
Joined
Nov 11, 2020
Messages
67
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am looking for a formula that can count the number of dates in column A that is associated with the month in column C. I was using Countif and Month formula; however, as data continues to grow, manually changing the formula by row is becoming an issue. Is there a way to have a formula for the quarter as well?

Thanking you in advance.

Calendar Days.xlsx
ABCDEFG
1DateMonthTotal by MonthDateQuarterTotal by Quarter
25/10/2021Jan-215/10/2021Q1
37/3/2021Feb-217/3/2021Q2
49/21/2021Mar-219/21/2021Q3
512/12/2021Apr-2112/12/2021Q4
64/15/2021May-214/15/2021
75/20/2021Jun-215/20/2021
86/20/2021Jul-216/20/2021
912/1/2021Aug-2112/1/2021
108/3/2021Sep-218/3/2021
117/15/2021Oct-217/15/2021
Sheet3
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
For the months, enter this into C2 and fill down.
Excel Formula:
=COUNTIFS(A:A,">="&B2,A:A,"<="&EOMONTH(B2,0))

Excel doesn't recognise quarters so you would need to use the start date of each quarter to identify the correct date range. Then you could use the same formula as above, changing the 0 at the end to 2 so that is spans a 3 month period.
 
Upvote 0
For the months, enter this into C2 and fill down.
Excel Formula:
=COUNTIFS(A:A,">="&B2,A:A,"<="&EOMONTH(B2,0))

Excel doesn't recognise quarters so you would need to use the start date of each quarter to identify the correct date range. Then you could use the same formula as above, changing the 0 at the end to 2 so that is spans a 3 month period.
Thank you Jasonb75. The first formula worked like a charm. As for the quarters, can you provide a visual example? For example what would column A look like? I set it to the first day of the Month

Calendar Days.xlsx
ABC
1DateQuarterTotal by Quarter
25/1/2021Q10
37/1/2021Q20
49/1/2021Q30
512/1/2021Q40
64/1/2021
75/1/2021
86/1/2021
912/1/2021
108/1/2021
117/1/2021
Sheet3
Cell Formulas
RangeFormula
C2:C5C2=COUNTIFS(A:A,">="&B2,A:A,"<="&EOMONTH(B2,2))
 
Upvote 0
No no no, you don't need to change the dates being counted, you need the start or each quarter as a reference point.

Using your original example (note that I've had to convert the dates to UK format so that I can test it with my settings).
Book1
ABCDEFGH
1DateMonthTotal by MonthDateQuarterTotal by Quarter
210/05/2021Jan-21010/05/2021Jan-21Q10
303/07/2021Feb-21003/07/2021Apr-21Q24
421/09/2021Mar-21021/09/2021Jul-21Q34
512/12/2021Apr-21112/12/2021Oct-21Q42
615/04/2021May-21215/04/2021
720/05/2021Jun-21120/05/2021
820/06/2021Jul-21220/06/2021
901/12/2021Aug-21101/12/2021
1003/08/2021Sep-21103/08/2021
1115/07/2021Oct-21015/07/2021
Sheet1
Cell Formulas
RangeFormula
H2:H5H2=COUNTIFS(E:E,">="&F2,E:E,"<="&EOMONTH(F2,2))
C2:C11C2=COUNTIFS(A:A,">="&B2,A:A,"<="&EOMONTH(B2,0))
 
Upvote 0
Solution
No no no, you don't need to change the dates being counted, you need the start or each quarter as a reference point.

Using your original example (note that I've had to convert the dates to UK format so that I can test it with my settings).
Book1
ABCDEFGH
1DateMonthTotal by MonthDateQuarterTotal by Quarter
210/05/2021Jan-21010/05/2021Jan-21Q10
303/07/2021Feb-21003/07/2021Apr-21Q24
421/09/2021Mar-21021/09/2021Jul-21Q34
512/12/2021Apr-21112/12/2021Oct-21Q42
615/04/2021May-21215/04/2021
720/05/2021Jun-21120/05/2021
820/06/2021Jul-21220/06/2021
901/12/2021Aug-21101/12/2021
1003/08/2021Sep-21103/08/2021
1115/07/2021Oct-21015/07/2021
Sheet1
Cell Formulas
RangeFormula
H2:H5H2=COUNTIFS(E:E,">="&F2,E:E,"<="&EOMONTH(F2,2))
C2:C11C2=COUNTIFS(A:A,">="&B2,A:A,"<="&EOMONTH(B2,0))
Thank you!
 
Upvote 0

Forum statistics

Threads
1,214,639
Messages
6,120,679
Members
448,977
Latest member
dbonilla0331

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