Q. Find the city name based on the city codes .....
I used the Vlookup function
The final answer displayed : Providence, RI
The answer should be - Providence
Attaching a sample data below...
How to proceed ?
Please help
Q. Find the city name based on the city codes .....
I used the Vlookup function
The final answer displayed : Providence, RI
The answer should be - Providence
Attaching a sample data below...
How to proceed ?
Please help
Hi Muskan27,
Pop this in cell H6 and copy it down:
=LEFT(VLOOKUP(G6,$A$2:$B$16,2,0),FIND(",",VLOOKUP(G6,$A$2:$B$16,2,0))-1)
NB - MKE doesn't find a match as there's a trailing space in cell G10.
Regards,
Snook
Last edited by The_Snook; 05-27-2020 at 08:24 AM. Reason: Corrected - Misread original requirement
In H6, then copy down (Note that MKE wont work because you have a space after it)
Formula:Please Login or Register to view this content.
or if there isn't always going to be a comma:
Formula:Please Login or Register to view this content.
Last edited by Arkadi; 05-27-2020 at 08:16 AM.
Please help by:
Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know
There are 10 kinds of people in this world... those who understand binary, and those who don't.
Thank you for helping me out ... it worked perfectly
Glad to hear it Please remember to mark the thread as solved? Thanks!
I have a doubt
In case the column positions are interchanged in the data set i.e., origin city name in the first column and origin city code in the second.. How will we answer using INDEX and/or MATCH functions ?
I have made modifications in the sample data ... new data set attached below
Hi muskan27,
In that instance you can use this:
=LEFT(INDEX($A$2:$A$16,MATCH(F6,$B$2:$B$16,0)),FIND(",",INDEX($A$2:$A$16,MATCH(F6,$B$2:$B$16,0)))-1)
Regards,
Snook
Formula:Please Login or Register to view this content.
Thanks ! The_Snook
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks