Assigning a "1" to the current quarter - formula broke today

BrettOlbrys1

Board Regular
Joined
May 1, 2018
Messages
128
Office Version
  1. 365
Platform
  1. Windows
I have 12 columns of data and each column contains data for a specific quarter (date range). Above each column a number should appear such that the CURRENT QUARTER (4/1/23 - 6/30/23) should have a "1" above it. Each preceding quarter would be 1 less than the previous quarter. For example, Q1 22 should be -4, Q2 22 should be -3, Q3 22 should be -2, Q4 22 should be -1, Q1 23 should be 0, and Q2 23 should be 1.

The formula I am using is this:

=IF(AND(TODAY()>=X226,TODAY()<=Y226),1,1+((12*(YEAR(X226)-YEAR(TODAY()))+MONTH(X226)-FLOOR(MONTH(TODAY()),3)-1)/3))

It was working fine until today, and it is now assigning a "1" to 7/1/23 - 9/30/23, a 0 to the current quarter, etc...

How do I fix this formula so the CURRENT QUARTER will always be assigned the number "1"?

Thanks

Brett
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
See if the following formula works for you:
Excel Formula:
=ROUND((TEXT(Y226,"yyyy mm\/\1\2")-(YEAR(TODAY())+CEILING(MONTH(TODAY())/3,1)/4))*4,0)+1
 
Upvote 0
See if the following formula works for you:
Excel Formula:
=ROUND((TEXT(Y226,"yyyy mm\/\1\2")-(YEAR(TODAY())+CEILING(MONTH(TODAY())/3,1)/4))*4,0)+1
Thanks for the formula. When I apply it, each Quarter is off by -1 (see RESULT). SHOULD BE is what I am looking to get.

RESULT
-4​
-3​
-2​
-1​
0​
1​
2​
SHOULD BE
-3​
-2​
-1​
0​
1​
2​
3​
QTR START DATE
4/1/22​
7/1/22​
10/1/22​
1/1/23​
4/1/23​
7/1/23​
10/1/23​
 
Upvote 0
Here is an amended formula ;)
Excel Formula:
=ROUND((TEXT(Y226,"yyyy mm\/\1\2")-(YEAR(TODAY())+CEILING(MONTH(TODAY())/3,1)/4))*4,0)+2
 
Upvote 0
Solution

Forum statistics

Threads
1,214,957
Messages
6,122,466
Members
449,086
Latest member
kwindels

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