How to match dates by month and year only in Excel?
When comparing dates in Excel, you may need to match the dates by month and year only without considering day. How to achieve it? The following methods will help you.
As below screenshot shown, supposing you need to compare two date lists and match the dates by month and year only, you can apply the below formula to achieve it.
1. Select a blank cell, enter formula =MONTH(A2)&YEAR(A2)=MONTH(B2)&YEAR(B2) into the Formula Bar, and then press the Enter key. See screenshot:
2. Keep selecting the result cell, drag the Fill Handle down to compare other dates. See screenshot:
If you want to compare a range of dates by month and year based on a given date, and highlight all matched cells as below screenshot shown, you can try the following Conditional Formatting methods. Please do as follows.
1. Select the date range you will highlight based on the month and year of a given date, and then click Home > Conditional Formatting > New Rule. See screenshot shown.
2. In the New Formatting Rule dialog box, you need to:
Note: In the formula, A2 is the first cell of selected date range, 2015,1,6 is the given date you need to compare with. Please change them based on your need.
After clicking the OK button, all cells which match the month and year of the given date will be highlighted immediately as blow screenshot shown.
- How to check if a cell value match to a list in Excel?
- How to count cells match to either X or Y in Excel?
- How to find matched value by searching upwards in Excel?
- How to sort a column to match the value in another column in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!