Counting Question

BrettOlbrys1

Board Regular
Joined
May 1, 2018
Messages
128
Office Version
  1. 365
Platform
  1. Windows
I am sure this is easy, but this is what I want to happen. I have a table with multiple columns based on a start date and end date. I want to assign "1" to the current quarter and each quarter thereafter, should respectively be assigned "2", "3", "4", etc...

So because today is 1/6/23, a "1" is assigned to the date range of 1/1/23 to 3/31/23 and the following quarters are 2, 3, etc. When there is a date next quarter, for example 5/2/23, a "1" will be assigned to the range (4/1/23 - 6/30/23).

What formula would I use for this?


Assigned Value
"0"​
"1"​
"2"​
"3"​
Start Date
10/1/22​
1/1/23​
4/1/23​
7/1/23​
End Date
12/31/22​
3/31/23​
6/30/23​
9/30/23​
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
In B1 then copy across.
Excel Formula:
=IF(AND(TODAY()>=B2,TODAY()<=B3),1,1+((12*(YEAR(B2)-YEAR(TODAY()))+MONTH(B2)-FLOOR(MONTH(TODAY()),3)-1)/3))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,921
Messages
6,122,280
Members
449,075
Latest member
staticfluids

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