How to check if a date is in the current quarter

chucktizzle

New Member
Joined
Nov 5, 2014
Messages
4
I'm trying to create a formula to check if the value in column I is within the current quarter and return with a 1(true) or 2(false). The formula needs to update automatically based on the current date.

This is the formula I'm using to check if the value is in the current month:
=IF(AND(YEAR(TODAY())=YEAR(I2),MONTH(TODAY())=MONTH(I2)),1,2)

I cannot figure out how to test for the current quarter. Thanks!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Excel 2013
AB
102/10/20141
Sheet1


<b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">B1</th><td style="text-align:left">=IF(<font color="Blue">(<font color="Red">INT(<font color="Green">(<font color="Purple">MONTH(<font color="Teal">A1</font>)-1</font>)/3</font>)+1</font>)=(<font color="Red">INT(<font color="Green">(<font color="Purple">MONTH(<font color="Teal">TODAY(<font color="#FF00FF"></font>)</font>)-1</font>)/3</font>)+1</font>),1,2</font>)</td></tr></tbody></table></td></tr></table><br />
 
Upvote 0
=IF((MONTH(NOW())-MONTH(I2))<3,1,2)

Does that do it?

looks like I took too long! and the other answers are better
 
Last edited:
Upvote 0
Thanks! This works for the quarter part. I just had to add an AND operator to include a check for the current year, but works great.
 
Upvote 0
This is close and is actually where I was getting hung up. This only checks to see if the date is within the last three months, not to see if it is in the current quarter. Thanks for the reply, though!
 
Upvote 0
If the quarter should also be within the same year as today then try this:
=IF(AND(CEILING(MONTH(I2),3)/3=CEILING(MONTH(TODAY()),3)/3,YEAR(I2)=YEAR(TODAY())),1,2)

edit: just noticed post #5
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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