Forum Discussion
VLOOKUP Help
Hi everyone,
Can someone please help me with using the VLOOKUP function. Attached below is a chart I am working with. Essentially I'm trying to search by location and return the corresponding name associated with it. However, when I use the formula: =VLOOKUP("Dallas",A2:B10,1,FALSE), instead of returning Jones, it returns #N/A. In addition, =VLOOKUP("Spain",A2:B10,1,FALSE), instead of returning Dawn, Morgan, and John, it returns #N/A. Can someone please help me this? I'm on a deadline and really frustrated with trying to figure this out! Thank you so much!!!
3 Replies
- SergeiBaklanDiamond Contributor
Thetest123 , VLOOKUP only looks to the right, you can't retrieve data from the column on the left. Use INDEX/MATCH instead, like
=IFNA(INDEX(A2:A10, MATCH("Dallas",B2:B10,0)),"no such")- Thetest123Copper Contributor
Oh I see! That makes sense. What about when there are duplicates of location like for Spain? Is there a way to use the index match to return all the corresponding names and not just the first one. When I use
=IFNA(INDEX(A2:A10, MATCH("Spain",B2:B10,0)),"no such")it only returns Dawn...is there a way for it to return Morgan and John as well?
- SergeiBaklanDiamond Contributor
Thetest123 , nope, INDEX/MATCH, as well as VLOOKUP, returns only first found value. You may only play with options how to find it. If the list of matched records that will be another technique.
And it depends on how you'd like to see the result on which Excel you are. If, for example, list of values for given criteria and you are Office365 subscriber you may use TEXTJOIN as