+ Reply to Thread
Results 1 to 4 of 4

Vlook up when duplicate values in the array table and lookup column

  1. #1
    Registered User
    Join Date
    10-02-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Vlook up when duplicate values in the array table and lookup column

    Hello,

    I have a list of zip codes (Col A) and district codes (Col B) in worksheet "Zips". I have another sheet "City" has list of zip codes (Col A) and the associated city names, county & state (Col B, C & D respectively). I'm trying to do a vlookup to get the city name in the "Zips" worksheet from the "City" worksheet . However, there are duplicate values in Col A of the "Zips" worksheet and in the Col A of the "City" worksheet.

    The vlookup gives me the city name which appears first in the array but not the subsequent city names if the zip code is duplicated. Is there a way to get the subsequent city names if the zip code is duplicated.

    I've attached the workbook.

    Your help is much appreciated.

    Vinod
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Vlook up when duplicate values in the array table and lookup column

    Hello Vinod,

    Try this in ZIps!C2 with CTRL+SHIFT+ENTER not just ENTER.

    =IFERROR(INDEX(City!B:B,SMALL(IF(City!A$2:A$3252=A2,ROW(City!A$2:A$3252)),COUNTIF(A$2:A2,A2))),"")

    If you hit 3 keys successfully you can see formula surrounded by {}, then drag down.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Registered User
    Join Date
    10-02-2012
    Location
    Washington DC, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Vlook up when duplicate values in the array table and lookup column

    Thank you very much Haseeb. This works like a charm.

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Vlook up when duplicate values in the array table and lookup column

    @ vinodt

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as "SOLVED".
    For the meantime I'll do it for you.

    How?
    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

    Note:
    You can also thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given.
    By doing so you can add to the reputation(s) of those who helped and shared their time in helping you.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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