+ Reply to Thread
Results 1 to 9 of 9

Vlookup Duplicate Value issue

Hybrid View

  1. #1
    Registered User
    Join Date
    09-02-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    87

    Question Vlookup Duplicate Value issue

    Hello friends,

    How to get correct value using vlookup formula in duplicate look up values.

    Here i mentioned a eg;

    VlookUp_DuplicateValue.JPG

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Vlookup Duplicate Value issue

    Hi,

    To ensure a better response please upload workbooks not pictures - see guidance in the rules area of the forum. People are reluctant to recreate your workbook when you already have a copy.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    09-02-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    87

    Question Re: Vlookup Duplicate Value issue

    Hi

    Please find my attached file.

    VlookUp_DuplicateValue.xlsx

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Vlookup Duplicate Value issue

    Try this array formula** entered in F2 and copied down:

    =INDEX(B:B,SMALL(IF(A$2:A$10=D3,ROW(A$2:A$10)),COUNTIF(D$3:D3,D3)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    Re: Vlookup Duplicate Value issue

    use VlookupNth:
    Function VLOOKUPNTH(lookup_value, table_array As Range, _
        col_index_num As Integer, nth_value)
        ' Extension to VLOOKUP function. Allows for finding
        ' the "nth" item that matches the lookup value.
    
        Dim nRow As Long
        Dim nVal As Integer
        Dim bFound As Boolean
        VLOOKUPNTH = "Not Found"
        With table_array
            For nRow = 1 To .Rows.Count
                If .Cells(nRow, 1).Value = lookup_value Then
                    nVal = nVal + 1
                    End If
                    If nVal = nth_value Then
                        VLOOKUPNTH = .Cells(nRow, col_index_num).Text
                        Exit Function
                    End If
                Next nRow
            End With
        End Function
    with the formula:
    Formula: copy to clipboard
    =VlookupNth(D3,$A$2:$B$10,2,COUNTIF($D$3:D3,D3))
    Sub Reputation()
    Dim Problem as Variant
    Dim Reputation as Integer
    For Each Problem in Forum.Threads
        If Problem.Title = "*[Solved]*" and Solver.Name = "Leon V (AW)" Then Reputation = Reputation + 1
    Next Problem
    End Sub

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Vlookup Duplicate Value issue

    Please see attached spreadsheet with an array formula
    Attached Files Attached Files
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Vlookup Duplicate Value issue

    Thank you for your feedback!

  8. #8
    Registered User
    Join Date
    09-02-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Vlookup Duplicate Value issue

    Hi Leon V (AW) ,Tony Valko & AlKey

    Thanks for your reply and time spend my question.
    Work perfect.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Vlookup Duplicate Value issue

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Vlookup issue - duplicate data
    By Deanoz in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 09-19-2012, 01:13 AM
  2. reverse vlookup how - duplicate issue
    By kerrold1 in forum Excel General
    Replies: 9
    Last Post: 02-08-2012, 10:54 AM
  3. duplicate issue
    By step_one in forum Excel General
    Replies: 2
    Last Post: 06-29-2011, 07:09 PM
  4. Complicated Duplicate Issue
    By roasty_1 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-02-2008, 05:52 AM
  5. Duplicate issue
    By kwright90 in forum Excel General
    Replies: 2
    Last Post: 04-25-2007, 04:17 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