How to compare two dates by month and year only in Excel?
If you have two lists of dates, now, you need to compare the dates by month and year only and ignoring the day value, if they have the same month and year, the result should be displayed as True, otherwise should be False as following screenshot shown. How to compare the dates only with month and year but ignoring the day in Excel?
To check if the dates have the same month and year, the following formulas can help you, please do as this:
Enter this formula into a blank cell beside your data, =AND(MONTH(A2)=MONTH(B2),YEAR(A2)=YEAR(B2)), C2, for instance, and then drag the fill handle down to the cells that you want to apply this formula, and you will get a TRUE if the two dates have the same month and year, otherwise, you will get a FALSE, see screenshot:
1. Here is another shorter formula also can help you: =(A2-DAY(A2))=(B2-DAY(B2)).
2. In the formulas, A2 and B2 is the two dates that you want to compare, please change the cell references as your need.
You are guest
or post as a guest, but your post won't be published automatically.
- To post as a guest, your comment is unpublished.· 8 months agoThis worked really well for me. It looks at the reference date (A1) and asks if the current month is today, and if not than is it past or future.
- To post as a guest, your comment is unpublished.· 10 months agoThis is a shorter formula to check if two dates fall in the same month: