Formula If Date Falls into Current Month

squeakums

Well-known Member
Joined
May 15, 2007
Messages
830
Office Version
  1. 365
I'm trying to write a formula (if date falls into current month)

This one isn't working:

=IF(AY3=MONTH(TODAY()),"Yes","No") It just creates No for everyone even those with dates that fall into the current month/year.

The field I'm viewing also has a formula into it - Ay3 does.. to pull dates.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
It looks like its flagging those in 2014 too in September, Can it be written to use the Current Month/Year?
 
Upvote 0
That works, thank you so much :) Do you know how to also write it - for another column to say if it is due the following month (due next month)?
 
Upvote 0
It would be something like this:

=IF(AND(MONTH(AY3)-1=MONTH(TODAY()),YEAR(AY3)=YEAR(TODAY())),"Yes","No")

Basically you calculate the month and subtract 1 then compare that it is equal to the current month.
 
Last edited:
Upvote 0
Sorry this would be slightly more robust as it will still work if the current month is december (next month is Jan)

=IF(AND(MONTH(EOMONTH(AY3,-1))-1=MONTH(TODAY()),YEAR(EOMONTH(AY3,-1))=YEAR(TODAY())),"Yes","No")
 
Upvote 0
=IF(AND(MONTH(AY3)=MONTH(TODAY()),YEAR(AY3)=YEAR(TODAY())),"Yes","No")
Here is another alternative that is a little shorter:
Code:
=IF(TEXT(AY3,"mmyyyy")=TEXT(TODAY(),"mmyyyy"),"Yes","No")
For the one month difference once, I would just incorporate the EDATE function into the formula above:
https://www.techonthenet.com/excel/formulas/edate.php
 
Last edited:
Upvote 0

Forum statistics

Threads
1,222,636
Messages
6,167,223
Members
452,104
Latest member
jadethejade

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