logo
search
Function Problems

How to Fix Excel VLOOKUP and HLOOKUP Errors Caused by Date Formatting

Bushra ParveenBushra Parveen Oct 15, 2026 869 views

Question details

VLOOKUP or HLOOKUP returns an #N/A error when trying to match dates that look identical on screen but have different underlying serial values.

How to Fix Excel VLOOKUP and HLOOKUP Errors Caused by Date Formatting
Product
Microsoft Excel / WPS Spreadsheet
Device & OS
not provided
Scenario
A user is looking up data based on a date formatted as mmm-yy (e.g., Jan 22). The actual date is not the first of the month, but the source data is on external restricted sheets and cannot be manually altered.
Observed behavior
The lookup function returns an #N/A error because the underlying date serial numbers do not match, despite the visual formatting being identical.
Before you start

Select the cells containing your lookup dates and check the formula bar to verify their true underlying values (e.g., 22/1/2022) before adjusting your formulas.

Solution 1Recommended

Normalize Lookup Dates Using the DATE Function

Use the DATE, YEAR, and MONTH functions within your formula to dynamically convert both comparison dates to the first day of the month.

Excel stores dates as sequential serial numbers. Formatting a date to show only the month and year (e.g., mmm-yy) changes its appearance but leaves the exact day intact. When a lookup function compares 22-Jan-22 to 1-Jan-22, it reads them as entirely different numbers and fails to find a match.

Since you cannot alter the restricted external source data, you must dynamically normalize the lookup date inside your formula so the dates align perfectly.

1
Identify your lookup value cell

Click on the cell containing your specific lookup date (for example, cell A2).

2
Normalize the lookup date to the first of the month

Construct a normalized date value inside your formula using DATE(YEAR(A2), MONTH(A2), 1).

3
Implement an array-based INDEX and MATCH

Instead of a standard VLOOKUP, use an array formula to normalize the restricted source column as well. Enter: =INDEX(return_range, MATCH(DATE(YEAR(A2),MONTH(A2),1), DATE(YEAR(lookup_range),MONTH(lookup_range),1), 0))

Normalize Lookup Dates Using the DATE Function
Evaluating Array Formulas: Depending on your version of Excel or WPS Spreadsheet, you may need to press Ctrl + Shift + Enter to evaluate this array formula properly.
Powerful Spreadsheet Alternative

Easily Manage Complex Formulas with WPS Spreadsheet

WPS Spreadsheet provides robust support for advanced date calculations and array formulas like VLOOKUP, HLOOKUP, and INDEX/MATCH. It handles complex data seamlessly while offering full Microsoft Excel compatibility.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your #N/A lookup errors.
  2. 2. Select the target cell: Click on the cell where you want to output the corrected lookup result.
  3. 3. Use the Insert Function tool: Navigate to the Formulas tab on the ribbon and click on 'Insert Function' (fx).
  4. 4. Build your normalized formula: Select INDEX or MATCH from the list and use the interactive wizard to safely nest your DATE functions without risking syntax errors.
100% compatible with Microsoft Excel (.xlsx, .xls) formats and lookup functions.Advanced formula auditing and error tracing tools to quickly identify #N/A issues.Free, lightweight, and fast alternative to Microsoft Office.Intuitive Formula Wizard for easily nesting DATE and TEXT functions.
microsoft office alternative - wps office

Frequently Asked Questions

Why does VLOOKUP return #N/A when my dates look visually identical?

VLOOKUP compares the underlying cell values, not the formatted display. If one cell holds 'Jan 22, 2022' and another holds 'Jan 1, 2022', but both are formatted to display as 'Jan-22', the spreadsheet software reads them as different serial numbers and fails to find a match.

Can I fix this by changing the cell format to 'Text'?

No. Simply changing a cell's number format to 'Text' via the formatting menu does not alter the underlying serial number of an existing date. You must use a function like TEXT() or re-enter the data manually as text.

What is the primary difference between VLOOKUP and HLOOKUP?

VLOOKUP (Vertical Lookup) searches for a match in the first column of a dataset and returns a value from a specified column in the same row. HLOOKUP (Horizontal Lookup) searches for a match in the first row of a dataset and returns a value from a specified row in the same column.