Explanation
In the example shown, cell G4 contains the lookup value, “Berlin”.
XLOOKUP is configured to find this value in the table, and return the population.
The formula in G5 is:
To return County instead of population, only the return array is changed.
XLOOKUP supports approximate and exact matching, wildcards (* ?)
for partial matches, and lookups in vertical or horizontal ranges….