Forum Discussion
Help w Drop Down Formula
- Jan 30, 2021
There are innumerable options, here are three using your data:
=LOOKUP(A2,A6:B8)
=VLOOKUP(A2,A6:B8,2)
=XLOOKUP(A2,A6:A8,B6:B8)
You might also work with INDEX/MATCH or INDEX/XMATCH
Shane Devenshire
Except LOOKUP() won't work, at least correctly, on unsorted names.
Actually, the first and third formulas require the data be sorted. If not the first formula needs to be =VLOOKUP(A2,A6:B8,2,0) or =VLOOKUP(A2,A6:B8,2,FALSE) .
- SergeiBaklanJan 31, 2021Diamond Contributor
No, sorting is not required for third formula, only first two.
By the way, three main reasons never use VLOOKUP() that's fixed column number, left to right and approximate search by default.
- Shane_DevenshireFeb 01, 2021Copper Contributor
Regarding "fixed column number, left to right and approximate search by default."
1. Column numbers don't need to be fixed.
2. You can do right to left lookups, even with VLOOKUP
3. Default approximate just means changing the 4th argument.
XLOOKUP solves these issues, but again not everyone is using a version that has this function.
- Shane_DevenshireFeb 01, 2021Copper Contributor
Sorry I entered the formulas in a different order in my sheet. XLOOKUP is really the best choice in my opinion, but not everybody has access to it. Nevertheless adding FALSE or 0 or add the comma with a blank after it to VLOOKUP in the 4th argument allows the data to be unsorted using exact match:
=VLOOKUP(A4,A2:B5,2,FALSE)
=VLOOKUP(A4,A2:B5,2,0)
=VLOOKUP(A4,A2:B5,2,)