Explanation

By default, XLOOKUP will return the first match in a data set.

However, XLOOKUP offers an optional argument called search_mode to control the order in which data is searched.

you’re free to see this option used in the example shown.

Excel formula: XLOOKUP latest by date

When an exact match is found, the corresponding price in column D is returned.

If no match is found, XLOOKUP will return #N/A.

Note: this example depends on data being sorted by date in ascending order.

Excel formula: XLOOKUP basic exact match

If data is unsorted,see this example.

XLOOKUP supports approximate and exact matching, wildcards (* ?)

for partial matches, and lookups in vertical or horizontal ranges….

Excel formula: XLOOKUP basic approximate match

Excel formula: Lookup latest price

Excel XLOOKUP function