+ Reply to Thread
Results 1 to 7 of 7

macro to do vlookup with multiple results

  1. #1
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    macro to do vlookup with multiple results

    Hello Girls/Guys,

    Appreciate your help once again. I have a macro below but it does not seem to work. Basically i'm trying to get multiple values from Column C if it matches Column B. As I know using Vlookup only returns the first result so tried with this macro but still does not work. Is there any other macro which can help with this?



    Color Name
    Red Adam
    Green Adam
    Blue Adam
    Red Bob
    Green Bob
    Yellow Bob
    Red Carl
    Blue Carl

    Result should be below in Column D & E once Macro has run

    Color Name
    Red Adam, Bob, Carl
    Green Adam, Bob
    Blue Adam, Carl
    Yellow Bob

    Hopefully someone can help me with this. :-)

    Kind Regards,
    Mark.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: macro to do vlookup with multiple results

    Hi,

    Here is a macro that can do it for you:

    Please Login or Register  to view this content.
    Regards,
    Stephen

    If you feel someone has helped you please thank them and click on the star on their post to add reputation.
    Please ensure that you use code tags where relevant, and mark solved threads as solved.
    Most of all please be respectful and understanding of others.

  3. #3
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: macro to do vlookup with multiple results

    You can build a function like this, but it is a bit slow. Maybe someone else has a better way:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: macro to do vlookup with multiple results

    Quote Originally Posted by spitfireblue View Post
    Hi,

    Here is a macro that can do it for you:

    Please Login or Register  to view this content.
    Hello SpitFireBlue,

    That works wonderfully. You my good sir, are truly a genius. Thanks for your help. :-)

    Kind Regards,
    Mark.

  5. #5
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: macro to do vlookup with multiple results

    Quote Originally Posted by spitfireblue View Post
    You can build a function like this, but it is a bit slow. Maybe someone else has a better way:

    Please Login or Register  to view this content.
    Hello SpitFireblue,

    have no idea how to use the function. :-(
    I think the macro actually helps a lot. It can help me to do vlookups with multiple values returning instead of the first one.

    Kind Regards,
    Mark.

  6. #6
    Valued Forum Contributor spitfireblue's Avatar
    Join Date
    01-29-2015
    Location
    Adelaide, Australia
    MS-Off Ver
    2007,2010,2016
    Posts
    611

    Re: macro to do vlookup with multiple results

    Hi Mark,

    Glad I could help

    Here is an example of how the function would work. It is basically a user defined formula in cell E2

    Function Example.xlsm

  7. #7
    Forum Contributor
    Join Date
    01-02-2015
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2007
    Posts
    272

    Re: macro to do vlookup with multiple results

    Quote Originally Posted by spitfireblue View Post
    Hi Mark,

    Glad I could help

    Here is an example of how the function would work. It is basically a user defined formula in cell E2

    Attachment 458931
    Hi SpitFireBlue,


    Wow this works as well. Thank you once again for providing me with this alternative sir. Really helps out my work a lot!!!:-)

    Kind Regards,
    Mark.

+ 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. Help using vlookup to return multiple results for one vlookup value
    By Akmon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-27-2015, 06:00 AM
  2. [SOLVED] using Vlookup with multiple results and averaging the results.
    By xatomicx in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2015, 10:19 AM
  3. [SOLVED] Vlookup with Multiple Results
    By Fletch74 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-18-2013, 09:01 PM
  4. [SOLVED] Help with multiple results when using vlookup
    By christopherjward in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-22-2013, 01:26 PM
  5. Vlookup, multiple row results
    By darvistor in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-01-2011, 06:30 PM
  6. VLOOKUP with multiple results
    By bronsonb in forum Excel General
    Replies: 4
    Last Post: 02-02-2010, 09:40 AM
  7. Vlookup with multiple results
    By spanna16 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-24-2009, 11:43 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