+ Reply to Thread
Results 1 to 7 of 7

Vlookup pulling two cells or more of text into one cell separated by a comma

  1. #1
    Registered User
    Join Date
    01-11-2013
    Location
    Lowell, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Vlookup pulling two cells or more of text into one cell separated by a comma

    9:27am
    Ginni Breault
    hi all. I have a Table that contains that may have duplicates in column A, which is my lookup value, but in column B there are different text strings. I need to place the text in column B into one cell like this: "Text 1", "Text 2". I tried to use & but it just repeated the first instance of my lookup value. I need the vlookup to scan down the column and reture each value in column B. Does that make sense?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Vlookup pulling two cells or more of text into one cell separated by a comma

    Welcome to the Forum!

    I do not find your description clear, but here is what I think you mean:

    I have data in column A and B. In a third column I am using VLOOKUP to find a value in A and return the corresponding value in B. However, the data in column A can be duplicated. In my third column I want to concatenate all values in B that correspond to the value I am searching for in A. For example:

    Please Login or Register  to view this content.
    I would like the result of searching for "A" to return "Cat, Elephant".

    Is that what you mean?

    VLOOKUP cannot do this. I am not sure if it can be done with formulas at all, but it can be done with a macro. I will see if anyone else comes up with a formula solution before I do any work on a macro.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    01-11-2013
    Location
    Lowell, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Vlookup pulling two cells or more of text into one cell separated by a comma

    That's what I mean! I will have
    1/12. "The Ghost"
    1/13 "The Zombie
    1/12. "The Bike"

    and what I need on my single cell is the values of A. Right now my Vlookup stops at the first A and I get "The Ghost" when I need: "The Ghost", "The Bike" in 1 cell

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Vlookup pulling two cells or more of text into one cell separated by a comma

    The attached file shows how you can do it with formulae. Column C contains a formula to give a unique reference to each record (I've hidden this), and the formula in G2 enables up to 3 multiples to be displayed (although it can easily be extended for more) - just change the lookup value in the yellow cell.

    Hope this helps.

    Pete
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-11-2013
    Location
    Lowell, MA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Vlookup pulling two cells or more of text into one cell separated by a comma

    I am thrilled with this! I will be attempting to make it work in my calendar tomorrow, and I am sure it work. This is brilliant!

    Thanks so much

  6. #6
    Registered User
    Join Date
    06-26-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Vlookup pulling two cells or more of text into one cell separated by a comma

    Is there a way to edit this formula to not pick up duplicates if there are any in column B
    Last edited by bradbracey; 01-16-2013 at 05:31 PM.

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Vlookup pulling two cells or more of text into one cell separated by a comma

    @bradbracey

    Read the Forum Rules at the top of the screen - you should not ask a question in someone else's thread, so start your own instead.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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