Excel Conditional Formatting Dates This Year Guide
In this article
To highlight dates occurring in the current calendar year in Excel, the most reliable method is using a conditional formatting formula: =YEAR(A1)=YEAR(TODAY()). This dynamic approach ensures that as the calendar flips to a new year, your spreadsheet automatically updates without requiring you to rewrite the rules manually. This is particularly useful for tracking annual budgets, project deadlines, or membership renewals where you only want to focus on the current year's data while ignoring archived records from previous years.
What You'll Need
- A Microsoft Excel workbook (works in Excel 365, 2021, 2019, and 2016).
- A column or range of cells containing valid Excel date values.
- Basic access to the Home tab on the Excel ribbon.
Step-by-Step
- Select Your Data Range: Click and drag to highlight the cells containing the dates you want to format. For example, if your dates are in cells A2 through A100, select that specific range. It is important to note which cell is the "active cell" (the one that remains white or highlighted differently within the selection); usually, this is the first cell you clicked. In our example, this is A2.
- Open Conditional Formatting: Navigate to the Home tab on the top ribbon. In the Styles group, click the Conditional Formatting button. (Note: Menu labels may vary slightly depending on your version of Excel or region).
- Create a New Rule: From the dropdown menu, select New Rule.... This opens a dialog box that allows you to define the logic for the formatting.
- Choose the Rule Type: In the "New Formatting Rule" window, click on the last option: Use a formula to determine which cells to format. This provides the most flexibility for date-based calculations.
- Enter the Formula: In the box labeled "Format values where this formula is true:", type the following formula:
=YEAR(A2)=YEAR(TODAY()).
Crucial Detail: Replace "A2" with the address of the first cell in your selected range. If your data starts in B5, use=YEAR(B5)=YEAR(TODAY()). Excel will automatically apply this logic relatively to every other cell in your selection. - Set the Format: Click the Format... button. A new window will appear where you can choose how the cells should look when the condition is met.
- To change the cell background, go to the Fill tab and select a color (e.g., light yellow).
- To change the text color, go to the Font tab and choose a color or make the text bold.
- Apply and Save: Click OK again in the New Formatting Rule dialog box. Your dates for the current year should now be highlighted.
Common Mistakes
One of the most frequent errors is using absolute references (dollar signs) in the formula. If you enter =YEAR($A$2)=YEAR(TODAY()), Excel will look only at cell A2 for every single cell in your range. If A2 is in the current year, every single cell in your selection will be highlighted, regardless of its own date. Always use a relative reference (A2) so the formula shifts as it moves down the column.
Another common mistake is entering dates as text. If you typed "January 1st 2024" into a cell and Excel treated it as a text string rather than a date value, the YEAR() function will return a #VALUE! error, and the formatting will not trigger. You can check if a cell is a true date by changing the cell format to "Number"; if the date turns into a five-digit number (like 45292), it is a valid Excel date.
Users also frequently forget to match the formula cell to the active cell of the selection. If you select range B10:B50 but write the formula starting with A1, the formatting will be offset by 10 rows and one column, leading to the wrong cells being highlighted.
Tips
Combining Rules: You can create multiple rules for the same range. For example, you can have one rule to highlight "This Year" in yellow and another rule to highlight "Next Year" in green. To do this, repeat the steps above but use the formula =YEAR(A2)=YEAR(TODAY())+1 for the following year.
Using Named Ranges: If your date list grows frequently, convert your data into an official Excel Table (Ctrl + T). When you apply conditional formatting to a table column, the rule automatically extends to new rows as you add them, meaning you don't have to manually update the range selection every month.
Dynamic Color Coding: If you want to highlight dates that are in the current year AND are already past (overdue), you can use the AND function: =AND(YEAR(A2)=YEAR(TODAY()), A2<TODAY()). This is incredibly powerful for tracking deadlines within the current calendar year.
Troubleshooting
If the formatting is not appearing or is highlighting the wrong cells, follow these steps in order:
- Check the Range: Go to Conditional Formatting > Manage Rules.... Look at the "Applies to" column. Ensure it covers the exact range of your dates (e.g.,
=$A$2:$A$100). - Verify the Formula Reference: In the same Manage Rules window, click Edit Rule. Ensure the cell reference in the formula matches the top-left cell of your "Applies to" range. If the range starts at A2, the formula must start with A2.
- Check for Date Formatting: Select a date cell and look at the Number format dropdown on the Home tab. If it says "Text," the formula won't work. Convert the column to "Date" format. If the dates don't change alignment (usually dates align right), you may need to use the "Text to Columns" feature to force Excel to recognize them as dates.
- Clear Conflicting Rules: If you have multiple rules, they may be overriding each other. In the Manage Rules window, check the order of the rules. You can use the up and down arrows to move a rule to the top. Check the "Stop If True" box if you want Excel to stop processing further rules once a match is found.
Frequently Asked Questions
Will this update automatically on January 1st?
Yes. Because the formula uses the TODAY() function, Excel recalculates the current date every time the workbook is opened or changed. On January 1st of next year, the previous year's dates will lose their formatting, and the new year's dates will be highlighted.
Can I highlight dates from a specific year instead of the current one?
Yes. Instead of using YEAR(TODAY()), simply replace that part of the formula with the specific year in quotes or as a number. For example, to highlight 2023, use =YEAR(A2)=2023.
Does this work in Excel Online?
Yes, conditional formatting using formulas is supported in Excel for the Web. The steps are nearly identical, though the menu layout may look slightly more streamlined than the desktop version.
What happens if the cell is blank?
Excel sometimes treats blank cells as a date in the year 1900. To prevent blank cells from being accidentally formatted (though unlikely to match the current year), you can wrap your formula in an AND statement: =AND(A2<>"", YEAR(A2)=YEAR(TODAY())).
Can I highlight the entire row instead of just the date cell?
Yes. Select the entire table range (e.g., A2:Z100). In the formula, use an absolute reference for the column but a relative reference for the row: =YEAR($A2)=YEAR(TODAY()). The $ before the A tells Excel to always look at column A for the date, even when it is formatting columns B, C, and D.