Given the calendar year end, which is Dec, we know that Quarter 1 is Jan - Mar, Quarter 2 is Apr - Jun, Quarter 3 is Jul - Sep and Quarter 4 is Oct - Dec.
My question is, is there a formula to get the correct quarter given the Year End (i.e. Apr Year End, Aug Year End, Dec Year End etc) and given the current month, it knows which quarter it'll be.
Below is the table of the quarters based on each month given it's year end.
\begin{array}{|c|c|c|c|} \hline & Dec\ (Year\ End) & Apr\ (Year\ End) & Aug\ (Year\ End) \\ \hline Jan & Q1 & Q3 &Q2\\ \hline Feb & Q1 & Q4 &Q2\\ \hline Mar & Q1 & Q4 &Q3\\ \hline Apr & Q2 & Q4 &Q3\\ \hline May & Q2 & Q1 &Q3\\ \hline Jun & Q2 & Q1 &Q4\\ \hline Jul & Q3 & Q1 &Q4\\ \hline Aug & Q3 & Q2 &Q4\\ \hline Sep & Q3 & Q2 &Q1\\ \hline Oct & Q4 & Q2 &Q1\\ \hline Nov & Q4 & Q3 &Q1\\ \hline Dec & Q4 & Q3 &Q2\\ \hline \end{array}
Please note that for Dec Year End, it means that Jan 1st is the start and Dec 31 is the end date.
Apr Year End, means that May 1 is the start and Apr 30th is the Year End.
Thanks for reply. Is there a way to take 'Dec', 'Apr' and 'Aug' as the numeric month itself, i.e 12, 4 and 8 respectively instead of 0, 1 and 2?
Reason being, I need to incorporate this formula in Excel to get the quarters.
– David.L Jul 21 '17 at 14:19Also, my apologies for being stupid here, but am I correct to assume that the value of the floor is then divided by 4, and the remainder is added to 1?
If it's the case, for some reason, I have for n = 12 (Dec) for Dec year end, I have 1 as the quarter.
f(0,12) = 1 +[floor((12-4*0)/3)]mod4 = 1 + [floor(12/3)mod4 = 1 + 0 = 1
– David.L Jul 21 '17 at 14:26That being said, for Dec year end, and for Dec month, I do get 1 as the value instead of 4.
Is my understanding of the formula wrong then?
Isn't 1 + floor(12/3 = 4)mod4 results in 1+0=1?
– David.L Jul 21 '17 at 14:42The same with April Year End, for the month of Apr, it's giving me Quarter 1 instead of Quarter 4.
In summary, it's off by 1.
– David.L Jul 21 '17 at 16:09