XLOOKUP
The modern replacement for VLOOKUP and INDEX/MATCH — look up a value and return a match in any direction.
XLOOKUP searches a lookup array and returns the corresponding item from a return array. It works left or right, defaults to exact match, and lets you supply a fallback when nothing is found.
Excel
=XLOOKUP(D2, A:A, B:B, "Not found")Google Sheets
=XLOOKUP(D2, A:A, B:B, "Not found")How it works
- 1D2 is the lookup value.
- 2A:A is the column to search.
- 3B:B is the column to return from.
- 4"Not found" is returned when there is no match.