VLOOKUP
VLOOKUP
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: VLOOKUP

  1. #1
    Guest

    Default

     
    Can I use vlookup with dublicate records?
    ex.

    ColumnA ColumnB
    1 tom
    2 steve
    3 mike
    3 joe

    How can I vlookup 3 and return joe?

    Any help would be great. I am new to excel.
    Thank you

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    If you only have 3 once, use:

    =VLOOKUP(3,A1:B10,1,FALSE)

    The False agument will mean it finds an exact match.

  3. #3
    New Member
    Join Date
    Mar 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Dave

    But I have 3 more than once. Was wondering if there is something I could do to find the 2nd 3.

    Thanks

  4. #4
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Ok then, as you are new to Excel I wont confuse the issue with a horribly long function, try this instead.

    Lets' assume your numeric data you want to lookup in in Column A. Insert a new column at Column A so that the data is now Column B. Now in Cell A2 put this:
    =IF(COUNTIF($A$1:A1,B2)=0,B2,"")

    Note the absolution of $A$1
    Copy this down as far as needed then use the VLOOKUP to look for the number you want in Column A eg:

    =VLOOKUP(3,A1:C100,3,FALSE)

  5. #5
    New Member
    Join Date
    Mar 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Dave,

    Again thanks for the help. Thats seems to find the 2nd one but i also need the first.
    I need to be able to vlookup but 3's with the different name attached.

    ex.
    ColumnA ColumnB
    1 tom
    2 steve
    3 mike
    3 joe

    need to vlookup 1st 3 with mike and 2nd 3 with joe.
    sorry if I wasn't that clear am new at this also.

    Thanks again
    DaBoyz1971

  6. #6
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    Try this link to my site, it has a Custom type vlookup that let's you nominate which istance to return.

    http://www.ozgrid.com/VBA/TwoColLkUp.htm

  7. #7
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    81,779
    Post Thanks / Like
    Mentioned
    12 Post(s)
    Tagged
    1 Thread(s)

    Default

      
    As is clear from the exchanges in this thread, you want to retrieve "joe" also when the lookup/key value is 3.

    Note 1. It is better, if possible, not to associate the same key value with different values.

    Assuming that A2:B5 houses your sample data:

    In D1 enter: 3 [ a lookup/key value ]

    In D2 enter:

    =IF(COUNTIF(A:A,$D$1)>0,VLOOKUP($D$1,$A$2:$B$5,2,0),"Not Found")

    In D3 enter:

    =IF(COUNTIF(A:A,$D$1)>COUNTA($D$2:D2),VLOOKUP($D$1,$B$5:INDIRECT("A"&MATCH($D2,$B$1:$B$5,0)+1),2,0),"")

    and copy down this till no more values are returned.

    Note 2. If your data area is frequently changing (that is, the area is dynamic), a different approach might be more appropriate.


    On 2002-03-09 17:06, Anonymous wrote:
    Can I use vlookup with dublicate records?
    ex.

    ColumnA ColumnB
    1 tom
    2 steve
    3 mike
    3 joe

    How can I vlookup 3 and return joe?

    Any help would be great. I am new to excel.
    Thank you

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com