Excel Formula: Check IF Two Dates Are In Same Month And Year
There are two lists of dates, now to check if the two dates in the same row are in the same month and year in Excel, which formula can you use? Here in this tutorial, a formula can help you.
If you want to follow along with this tutorial, please download the example spreadsheet.
Generic formula:
MONTH(date1)&YEAR(date1)=MONTH(date2)&YEAR(date2) |
Syntaxt and Arguments
Date1, date2:the two dates you want to check if are in the same year and month. |
Return Value
The formula returns to a logical value “TRUE” or “FALSE”. “TURE” indicates the two dates are in the same month and year, otherwise, it returns “FALSE”.
How this formula works
To compare two lists in the range B3:B5 and C3:C5 and check if the dates in the same row are in the same year and month, using below formula:
=MONTH(B3)&YEAR(B3)=MONTH(C3)&YEAR(C3) |
Press Enter key and drag auto fill handle down to cell D5.
Explanation
MONTH function: returns month as integer number by the given date.
YEAR function: returns year as integer number by the given date.
=MONTH(B3)&YEAR(B3)=MONTH(C3)&YEAR(C3)
=4&2020=5&2020
=42020=52020
=FALSE
Note
If you just want to check if the dates are in same month or same year, use the formula like:
MONTH(date1)=MONTH(date2) |
or
YEAR(date1)=YEAR(date2) |
Relative Formulas
- Check if a date is workday
This tutorial provides a formula to to check a date if is a workday. - Count Specific Weekday Between Two Dates
This tutorial provides the formula to count a specific weekday between two given dates in Excel. - Count Days From Today
This tutorial provides the best formula to calculate the difference between a date and today in Excel. - Convert Weekday in A Date Range
If there is a list of dates, how can you count a certain day of week in such a list of dates?
Relative Functions
- Excel WEEKNUM Function
Returns the week number of the given date in a year - Excel WORKDAY Function
Adds workdays to the given start date and returns a workday - Excel MONTH Function
The MONTH is used to get the month as integer number (1 to 12) from date - Excel DAY Function
DAY function gets the day as a number (1 to 31) from a date - Excel NOW Function
Get the current time and date
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
