COUNTIFS formula for number of dates in a quarter??

mattbird

Active Member
Joined
Oct 15, 2013
Messages
305
Office Version
  1. 2016
Hi,

I am using the following formula to count the number of dates that fall between Apr and Jun:

=COUNTIFS(P13:P15,">="&"04/01/2024",P13:P15,"<="&"30/06/2024")

But I need it to be rolling, otherwise every year I'm going to have to update the formula. Is there a way around this, so regardless of the year it will count between Apr and Jun?

I am doing the same for Jul-Sep, Oct-Dec and Jan-Mar as these are my quarters for the financial year etc.

If there is a better way of doing this, please let me know.

Thanks Matt
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
But I need it to be rolling,
Might need a bit more detail about just what you mean by that. For a start, could you do something like this where the financial year is entered in a cell (R11 for me) and the formulas refer to that.

24 03 25.xlsm
PQR
112024-2025
12DateResults
131/04/2024Apr-Jun3
1418/11/2024Jul-Sep2
1530/06/2024Oct-Dec4
161/07/2024Jan-Mar1
17
183/10/2024
198/10/2024
208/05/2024
2129/12/2024
222/02/2025
2330/09/2024
Count Qtrs
Cell Formulas
RangeFormula
R13R13=COUNTIFS(P13:P23,">="&DATE(LEFT(R11,4),4,1),P13:P23,"<="&DATE(LEFT(R11,4),6,30))
R14R14=COUNTIFS(P13:P23,">="&DATE(LEFT(R11,4),7,1),P13:P23,"<="&DATE(LEFT(R11,4),9,30))
R15R15=COUNTIFS(P13:P23,">="&DATE(LEFT(R11,4),10,1),P13:P23,"<="&DATE(LEFT(R11,4),12,31))
R16R16=COUNTIFS(P13:P23,">="&DATE(RIGHT(R11,4),1,1),P13:P23,"<="&DATE(RIGHT(R11,4),3,31))
 
Upvote 0
Hi Peter,

Thanks for your help. your example is similar to my table, but can this be done without having R11? so no matter what the financial year is it will still count etc. I'm trying to also reduce the risk of other having to amend cells each year. Does this make sense?
 
Upvote 0
your example is similar to my table, but can this be done without having R11?
Do all of the dates in column P fall within a single financial year?

When will you be using the formula? I ask because if the formula is used in, say September 2024 then the year value for the Apr-Jun quarter (for example) could be obtained by YEAR(TODAY())
However, if the formula was being used in say February 2025 then the year value for the Apr-Jun quarter would need to be YEAR(TODAY())-1
 
Upvote 0
This might work for you.

Book3
PQR
11
12DateResults
131/04/2024Apr-Jun3
1418/11/2024Jul-Sep2
1530/06/2024Oct-Dec4
161/07/2024Jan-Mar1
17
183/10/2024
198/10/2024
208/05/2024
2129/12/2024
222/02/2025
2330/09/2024
Sheet1
Cell Formulas
RangeFormula
R13:R16R13=COUNTIFS($P$13:$P$23,">="&DATE(YEAR(MIN($P$13:$P$23)),3*ROWS(Q$13:Q13)+1,1),$P$13:$P$23,"<="&DATE(YEAR(MIN($P$13:$P$23)),3*ROWS(Q$13:Q13)+4,0))
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,029
Members
449,092
Latest member
ikke

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