Explanation

XLOOKUP offers several features that make it exceptionally good for more complicated lookups.

In this example, we want the latest price for an itemby date.

If data were sorted by date in ascending order, this would bevery straightforward.

Excel formula: XLOOKUP last match

However, in this case,data is unsorted.

By default, XLOOKUP will return thefirst matchin a data set.

This array acts like a filter.

Excel formula: Nearest location with XMATCH

XLOOKUP looks through the lookup array for the maximum date value.

The final result is the price associated with the latest date.

The formula will continue to work when the data sorted in any order.

Excel formula: XLOOKUP with multiple criteria

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

MAX ignores empty cells, the logical values TRUE and FALSE, and text values.

Excel formula: XLOOKUP with logical criteria

Excel formula: XLOOKUP basic approximate match

Excel formula: Lookup latest price

Excel XLOOKUP function

Excel MAX function