Formula Errors

Fix an Excel IF Date Comparison That Always Returns FALSE

Camila MilosovichCamila Milosovich Nov 12, 2026 868 views

Question details

The user needs to fix an IF formula that returns FALSE even though two displayed dates appear to match.

Fix an Excel IF Date Comparison That Always Returns FALSE
Product
Microsoft Excel
Device & OS
not provided
Scenario
Comparing a date in a worksheet cell with a date value in an AnnualLedger table or range.
Observed behavior
The IF comparison returns FALSE because one or both dates may be stored as text, include different time values, or come from incompatible ranges.
Before you start

Check the formula bar for both date cells, because identical date formatting does not confirm that their underlying values are the same. Test each date with ISNUMBER before changing the comparison formula.

Solution 1Recommended

Convert both compared values to real dates and remove hidden times

Use this solution when dates look identical on the sheet but an IF equality test returns FALSE.

Excel stores valid dates as serial numbers. A text date cannot equal a real date value, and a date with a hidden time such as 12:00 PM will not equal the same date at 12:00 AM.

1
Test whether each value is a numeric date

In an empty cell, enter =ISNUMBER(C5). Then test the table value with =ISNUMBER(AnnualLedger[@CombinedDate]). TRUE means the value is stored as a numeric date; FALSE means it is text or another non-date value.

2
Convert a text date

If ISNUMBER returns FALSE, enter =DATEVALUE(C5) for text containing only a date, or =VALUE(C5) when the text may include a time. Copy the result and use Paste Special > Values to replace the original value if needed.

3
Remove time portions before comparing

If both values are real dates but may contain times, compare the date-only serial values with =IF(INT(C5)=INT(AnnualLedger[@CombinedDate]),"Match","No match").

4
Use a direct IF comparison after normalization

When both source cells contain date-only numeric values, use =IF(C5=AnnualLedger[@CombinedDate],"Match","No match") and fill the formula down within the table row.

Convert both compared values to real dates and remove hidden times
Date values are aligned: When both ISNUMBER checks return TRUE and the time components are removed where necessary, matching calendar dates will compare correctly.
WPS Spreadsheet formula tools

Compare and Match Dates Reliably in WPS Spreadsheet

WPS Spreadsheet lets you test date values, remove time components, and use IF, XLOOKUP, or INDEX/MATCH formulas to compare dates and return related table data. Its familiar spreadsheet layout makes it easy to move existing Excel workbooks into WPS Office.

  1. 1. Open the workbook in WPS Spreadsheet: Launch WPS Office, select Spreadsheets, and open the affected .xlsx or .xls workbook.
  2. 2. Check the date storage type: Select an empty cell and enter =ISNUMBER(C5) to determine whether the first compared value is a real date number.
  3. 3. Normalize dates before comparison: Use =INT(C5) and =INT(AnnualLedger[@CombinedDate]) in helper cells when hidden time values may be included.
  4. 4. Enter the matching formula: Use =IF(INT(C5)=INT(AnnualLedger[@CombinedDate]),"Match","No match") for a row comparison, or enter XLOOKUP to retrieve data from the matching table date.
Use ISNUMBER, DATEVALUE, VALUE, and INT to diagnose date comparison errors.Create IF and lookup formulas with a familiar Excel-style formula workflow.Open and edit Microsoft Excel .xlsx and .xls files with format compatibility.Work in a free, lightweight office suite with an easy-to-use spreadsheet interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why do two dates that look the same return FALSE in an IF formula?

The values may not be the same underlying serial number. One may be text, or one may include a hidden time. Use =ISNUMBER(cell) to check the storage type and =INT(cell) to compare date-only values.

How can I tell whether an Excel date is stored as text?

Enter =ISNUMBER(C5) in a blank cell. FALSE indicates that C5 is not stored as a numeric date. Convert date text with =DATEVALUE(C5), or use =VALUE(C5) if the value can include time information.

Does changing the date format fix an IF date comparison?

No. Home > Number Format changes only the displayed appearance. It does not convert text into a real date or remove a time value stored with the date.

How do I ignore time when comparing two dates?

Wrap both references in INT, such as =IF(INT(C5)=INT(D5),"Match","No match"). INT removes the fractional time portion from an Excel date-time serial number.

Which formula should I use to find a matching date in another table?

Use =XLOOKUP(C5,AnnualLedger[CombinedDate],AnnualLedger[Text],"") for an exact match. If XLOOKUP is unavailable, use =IFERROR(INDEX(AnnualLedger[Text],MATCH(C5,AnnualLedger[CombinedDate],0)),"").