+ Reply to Thread
Results 1 to 9 of 9

vlookup function

  1. #1
    Registered User
    Join Date
    05-13-2020
    Location
    india , delhi
    MS-Off Ver
    2016
    Posts
    11

    vlookup function

    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
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: vlookup function

    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

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: vlookup function

    In H6, then copy down (Note that MKE wont work because you have a space after it)

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    or if there isn't always going to be a comma:

    Formula: copy to clipboard
    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.

  4. #4
    Registered User
    Join Date
    05-13-2020
    Location
    india , delhi
    MS-Off Ver
    2016
    Posts
    11

    Re: vlookup function

    Thank you for helping me out ... it worked perfectly

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: vlookup function

    Glad to hear it Please remember to mark the thread as solved? Thanks!

  6. #6
    Registered User
    Join Date
    05-13-2020
    Location
    india , delhi
    MS-Off Ver
    2016
    Posts
    11

    Re: vlookup function

    Quote Originally Posted by Arkadi View Post
    In H6, then copy down (Note that MKE wont work because you have a space after it)

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    or if there isn't always going to be a comma:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    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
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: vlookup function

    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

  8. #8
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: vlookup function

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    05-13-2020
    Location
    india , delhi
    MS-Off Ver
    2016
    Posts
    11

    Re: vlookup function

    Thanks ! The_Snook

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Formula Structure Error When Combining IF Function with VLOOKUP Function
    By EverClever in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-16-2017, 03:11 PM
  2. [SOLVED] VLOOKUP formula or VLOOKUP worksheet.function
    By Crispy85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-09-2017, 09:40 AM
  3. Replies: 2
    Last Post: 01-15-2014, 11:40 PM
  4. Need help nesting an index/match function within a Vlookup function.
    By Christopher135 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2013, 06:16 PM
  5. Worksheet function Vlookup and VLOOKUP return different results
    By zandero in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2010, 08:24 AM
  6. Replies: 1
    Last Post: 12-02-2005, 09:35 AM
  7. vlookup function-Can vlookup command find the data from the 5 sheets.
    By Rishab shah in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1