+ Reply to Thread
Results 1 to 9 of 9

Vlookup On Duplicate Fields with Multiple Values

  1. #1
    Registered User
    Join Date
    03-11-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    5

    Question Vlookup On Duplicate Fields with Multiple Values

    Hi All,

    I'm basically trying to vlookup Header 2 on spreadsheet 1, from header 2 on spreadsheet 2. As you can see, there are multiple lookup references and values, and I'd like for the vlookup to match those (see attached pic).

    Excel Help.png

    Is there an appropriate formula which I can use to resolve this? Appreciate any inputs from the experts here.

    Thanks!!!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Vlookup On Duplicate Fields with Multiple Values

    Hi and welcome to the forum

    Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    03-11-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    5

    Re: Vlookup On Duplicate Fields with Multiple Values

    Hi Alan,

    Thank you for your inputs. File is as attached. I'll also take note of this on future postings.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Vlookup On Duplicate Fields with Multiple Values

    The problem with this is VLOOKUP will return the first match of the value every time. That is, for A it will match 2, B with 2, and C not at all. This is problematic since there are also values of 3 that could be matched for A as well. You could do something along the lines of "Match the second A in Spreadsheet 2", but there are an unequal number of As and Bs between Spreadsheet 1 and Spreadsheet 2.
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  5. #5
    Registered User
    Join Date
    03-11-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    5

    Re: Vlookup On Duplicate Fields with Multiple Values

    Yeah thats what i figured too. I had initially used this array formula as a stop gap measure:

    ={INDEX($G$2:$g$780, SMALL(IF(B$5=$F$2:$F$780, ROW(Reference!$F$2:$F$780)-MIN(ROW($F$2:$F$780))+1, ""), ROW(A1)))}

    The issue here is that I keep having to refresh the formula to (Row(A1)) at the start of each series. Thing is, im dealing with thousands of line items in a single spreadsheet so its kinda time consuming to refresh the formulas manually.

  6. #6
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Vlookup On Duplicate Fields with Multiple Values

    A non-array method that may work more efficiently would be to insert this into the column next to your Spreadsheet 2 data:

    Please Login or Register  to view this content.
    and drag down. You can hide this column later.

    Then, try this in B5 and drag down:

    Please Login or Register  to view this content.
    Again though, this is a little worrisome since the data to match ranges aren't the same.

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Vlookup On Duplicate Fields with Multiple Values

    Pl See file
    Formula
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-11-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    5

    Re: Vlookup On Duplicate Fields with Multiple Values

    Mc n kv,

    Thanks for the sharing. I will view these later in office and will post my feedback here.

    Mucho gracias!!!

  9. #9
    Registered User
    Join Date
    03-11-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    5

    Re: Vlookup On Duplicate Fields with Multiple Values

    Hi Both,

    The formulas you have provided both works in its desired context.

    Thanks man. Really appreciate your inputs and you both have just saved me a lot of manual work. Cheers!!

+ 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 to return multiple values for duplicate matching keys
    By abc_123excel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2013, 09:58 PM
  2. Counting the number of fields in a column for which there are duplicate values.
    By sangreal2007 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-24-2013, 03:59 AM
  3. vlookup with multiple duplicate values
    By bnasty in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2012, 06:06 PM
  4. vlookup with multiple duplicate values
    By bnasty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2012, 05:13 PM
  5. Combining Multiple Fields with Duplicate Data
    By rechewjr in forum Excel General
    Replies: 1
    Last Post: 03-11-2008, 09:12 AM

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