Show an Excel Lookup Date Only If It Is Before Today
Question details
Return a looked-up date only when it is yesterday or earlier, and otherwise display a blank.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A formula looks up a name in a pile log and retrieves its associated date.
- Observed behavior
- The desired result is a date before today; zero, today's date, and future dates should display as blank.
Check that the lookup names are in column A and the dates are in column I of the source sheet. Make sure the source dates are stored as actual dates rather than text, and adjust the sheet and column references if needed.
Filter the lookup result with LET and XLOOKUP
Use this formula in an Excel version that supports LET and XLOOKUP to perform the lookup once.
Click the cell in the table where you want the lookup date to appear. The formula uses [@Name] as the current row's lookup value.
In the formula bar, enter =LET(d,XLOOKUP([@Name],'McLH As built - Pile logs'!A:A,'McLH As built - Pile logs'!I:I),IF(OR(d=0,d>=TODAY()),"",d)) and press Enter.
Select the result cells, then use Home > Number Format > Short Date or another date format. Copy the formula down if the table does not fill it automatically.

Filter lookup dates in WPS Spreadsheet
Use a VLOOKUP formula in WPS Spreadsheet to return a date only when it is before today. This approach uses a standard cell reference for the lookup name.
- 1. Open the workbook: Open WPS Spreadsheet and select Menu > Open to choose your Excel workbook.
- 2. Check the references: Place the lookup name in A2 on the current sheet, or change A2 in the formula to the cell containing the name. Confirm that the source sheet has names in column A and dates in column I.
- 3. Enter the formula: Click the result cell and enter =IF(OR(VLOOKUP(A2,'McLH As built - Pile logs'!A:I,9,FALSE)=0,VLOOKUP(A2,'McLH As built - Pile logs'!A:I,9,FALSE)>=TODAY()),"",VLOOKUP(A2,'McLH As built - Pile logs'!A:I,9,FALSE)), then press Enter.
- 4. Format and fill: Use the Home tab's number format controls to format the result as a date, then drag the cell's fill handle down to apply the formula to other rows.

Frequently Asked Questions
Why does the formula exclude today's date?
The test d>=TODAY() matches today and any later date, so the IF function returns an empty string for those results.
What happens if the lookup name is not found?
XLOOKUP returns #N/A by default. Add "" as its fourth argument to display a blank when no name matches.
Why does the result show a number instead of a date?
Excel stores dates as serial numbers. Select the result cell and choose Home > Number Format > Short Date to display it as a date.
Is the cell truly empty when the formula shows a blank?
No. The formula returns an empty string (""), so the cell looks blank but still contains a formula.
Will the result change as the date changes?
Yes. TODAY() uses the current date when the workbook recalculates, so a date that is today can appear after it becomes yesterday.




