XLOOKUP and INDEX/MATCH
Look up in any direction, by position or by match.
=XLOOKUP(what, where to look, what to return) finds the value and returns the matching cell from the return range, in any direction. In older sheets, MATCH(what, range, 0) gives the position of an exact match inside a range, and INDEX(range, n) returns the nth cell. Together, INDEX(return range, MATCH(...)) does the same job as XLOOKUP.
Example: Nia is the 3rd name in A2:A6. Find her Rate in D2:D6.
- MATCH("Nia",A2:A6,0) = 3 — Position in the range, not the row
- INDEX(D2:D6,3) — The 3rd cell of D2:D6 is D4
- Same as XLOOKUP("Nia",A2:A6,D2:D6)
Why it works: MATCH says how far down the list the name is, and INDEX goes the same distance down another column. Because the columns line up, that lands on the same row.
Tip: XLOOKUP has an optional 4th part, the value to show if nothing is found, so you don’t get #N/A.