Formula Errors

Fix an Excel IF Formula to Check Dates in the Current Year

Aamir Naveed AkramAamir Naveed Akram Dec 2, 2026 868 views

Question details

Determine whether a date in Excel falls within the current year and return the appropriate IF result.

Fix an Excel IF Formula to Check Dates in the Current Year
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.
Before you start

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.

Solution 1Recommended

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.

1
Check the date value

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.

2
Enter the current-year formula

Select the result cell and enter =IF(YEAR(A1)=YEAR(TODAY()),"Condition1","Condition2"). Replace the quoted labels with your desired results or expressions.

3
Test the result

Enter dates from the previous, current, and next year in A1 to confirm that only the current-year date returns Condition1.

Compare the Date’s Year With the Current Year
Dates displayed as month and year: A value displayed as Apr-24 can be a real date with a custom format or text. If ISNUMBER(A1) returns FALSE, convert the text to a date before using the formula.
WPS Spreadsheet

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. 1. Open your spreadsheet: Open WPS Spreadsheet and use Open to select your workbook.
  2. 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. 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. 4. Save the workbook: Use Save or Save As to keep the updated workbook in your preferred Excel-compatible format.
Test dates against the current year with familiar spreadsheet functionsOpen and edit Microsoft Excel XLSX and XLS filesWork with formulas in a familiar spreadsheet interface
QA img-9

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.