Function Problems

Show an Excel Lookup Date Only If It Is Before Today

Anum MushtaqAnum Mushtaq Nov 18, 2026 869 views

Question details

Return a looked-up date only when it is yesterday or earlier, and otherwise display a blank.

Show an Excel Lookup Date Only If It Is Before Today
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the result cell

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.

2
Enter the formula

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.

3
Format the result as a date

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 the lookup result with LET and XLOOKUP
Missing names: XLOOKUP returns #N/A when a name is not found. To show a blank instead, add "" as its fourth argument: XLOOKUP([@Name],'McLH As built - Pile logs'!A:A,'McLH As built - Pile logs'!I:I,"").
Work with dates in WPS Spreadsheet

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. 1. Open the workbook: Open WPS Spreadsheet and select Menu > Open to choose your Excel workbook.
  2. 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. 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. 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.
Display only lookup dates before todayOpen and edit Microsoft Excel XLSX filesUse familiar spreadsheet formulas and date formattingWork with a free, easy-to-use office suite
microsoft office alternative - wps office

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.