Fix an Excel IF Formula to Check Dates in the Current Year
Question details
Determine whether a date in Excel falls within the current year and return the appropriate IF result.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An IF formula compares a date in A1 with December 31 of the current year.
- Observed behavior
- The comparison includes dates from previous years, and a date stored as text may produce an unexpected result.
Identify the cell containing the date and check that it holds a real Excel date rather than text. Confirm that your device’s date is correct because TODAY() uses the current date.
Compare the Date’s Year With the Current Year
Use YEAR and TODAY to test whether A1 contains a date in the current year.
A comparison with December 31 alone also includes all earlier dates, including those in previous years. Comparing the year values limits the match to the current year.
In an empty cell, enter =ISNUMBER(A1). TRUE indicates that A1 contains a number, as Excel dates do; verify that the value is the intended date.
Select the result cell and enter =IF(YEAR(A1)=YEAR(TODAY()),"Condition1","Condition2"). Replace the quoted labels with your desired results or expressions.
Enter dates from the previous, current, and next year in A1 to confirm that only the current-year date returns Condition1.

Convert a Text Date Before Applying the Formula
Use DATEVALUE when A1 contains date text that Excel can recognize.
Check Current-Year Dates in WPS Spreadsheet
Use IF, YEAR, and TODAY in WPS Spreadsheet to identify dates in the current year and return your chosen results.
- 1. Open your spreadsheet: Open WPS Spreadsheet and use Open to select your workbook.
- 2. Check the date cell: Enter =ISNUMBER(A1) in an empty cell to check that the date in A1 is stored as a number.
- 3. Enter the formula: Select a result cell and enter =IF(YEAR(A1)=YEAR(TODAY()),"Condition1","Condition2"). Replace the labels with your preferred results.
- 4. Save the workbook: Use Save or Save As to keep the updated workbook in your preferred Excel-compatible format.

Frequently Asked Questions
Why does my December 31 comparison include dates from previous years?
The condition A1<=DATE(YEAR(TODAY()),12,31) checks only the upper limit. Any earlier date also meets that condition, including dates in previous years.
How can I tell whether an Excel date is stored as text?
Enter =ISNUMBER(A1) in an empty cell. TRUE means A1 contains a number, as real Excel dates do; FALSE can indicate that the date is stored as text.
Will a date displayed as Apr-24 work in the YEAR formula?
Yes, if it is a real date formatted to display as month and year. Use =ISNUMBER(A1) to check; if it returns FALSE, convert the text to a recognized date first.
How does the formula know which year is current?
TODAY() returns the current date, and YEAR(TODAY()) extracts its year. Check your device’s date if the result does not match the year you expect.




