Fix VLOOKUP #N/A Errors for Dates in Excel and WPS Spreadsheets
Question details
Find out why a VLOOKUP formula returns #N/A for some date values and correct the lookup.

- Product
- Excel and WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- A spreadsheet uses VLOOKUP to find dates in a lookup range and return values from another column.
- Observed behavior
- The formula works for some rows but returns #N/A for later rows.
Check the VLOOKUP formula's fourth argument and identify the first column of its lookup range. Confirm that the range includes the return column and that its date values are stored as dates rather than text.
Sort the lookup range by date in ascending order
Use this method to keep approximate matching when the fourth VLOOKUP argument is omitted or set to TRUE.
VLOOKUP uses approximate matching by default. For reliable results, the first column of the lookup range must be sorted in ascending order. An approximate match returns the largest lookup value less than or equal to the requested value.
Select all columns in the lookup table, including the date column and the column containing the values to return.
Open Data > Sort, choose the first column of the lookup range, and sort from oldest to newest. If prompted, expand the selection so each row stays together.
Return to the VLOOKUP formulas and check the rows that previously showed #N/A. A lookup date earlier than every date in the table can still return #N/A.

Use FALSE to match dates exactly
Use an exact match when the lookup date must be present in the first column of the lookup range.
Fix date lookups in WPS Spreadsheets
Open your spreadsheet in WPS Spreadsheets, sort the lookup table by date or update VLOOKUP to require an exact match, and check the results.
- 1. Open the workbook: Launch WPS Spreadsheets and use Open to select your workbook.
- 2. Inspect the formula: Select a cell showing #N/A and check the VLOOKUP formula in the formula bar for its lookup range and fourth argument.
- 3. Correct the lookup: For approximate matching, select the full lookup table and use Data > Sort to sort its first column from oldest to newest. For exact matching, add FALSE as the fourth argument.
- 4. Check and save: Review the affected rows, then select Save to keep the changes.

Frequently Asked Questions
Why does VLOOKUP return #N/A when the dates are sorted newest to oldest?
When the fourth argument is omitted or TRUE, VLOOKUP expects the first lookup column to be sorted in ascending order. Select the full lookup table and use Data > Sort to order the dates from oldest to newest.
Do I need to sort dates when using VLOOKUP with FALSE?
No. FALSE requests an exact match, so the lookup column does not need to be sorted. The lookup value must match a value in the first column of the lookup range.
Why does an exact date match still return #N/A?
The dates may only look the same: one may be stored as text, or one may include a time component. Select the cells and check their underlying values, then convert them to matching date values.
Can approximate VLOOKUP return a date that is not an exact match?
Yes. With TRUE or an omitted fourth argument, VLOOKUP can return the row for the largest date less than or equal to the lookup date, provided the first lookup column is sorted in ascending order.




