+ Reply to Thread
Results 1 to 3 of 3

If content in column 1 matches, pull all data into one cell separated by a column

  1. #1
    Registered User
    Join Date
    02-02-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    1

    If content in column 1 matches, pull all data into one cell separated by a column

    Hello,
    Looking for a formula that will look at column 1 and combine the items that match into one column separating details by a comma.
    I've attached a sample excel workbook. Any assistance would be appreciated.

    sample-excel.xlsx

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If content in column 1 matches, pull all data into one cell separated by a column

    You will need a user-defined function for this.

    Hit Alt+F11 and go to Insert|Module... then paste this code in the editor:

    Please Login or Register  to view this content.
    Then in the spreadsheet in B2 enter formula:

    =IF(A2="","",SUBSTITUTE(TRIM(aconcat(IF(samplecontent!$A$2:$A$9=A2,samplecontent!$B$2:$B$9," ")))," ",","))

    and confirm it with CTRL+SHIFT+ENTER not just ENTER so that { } brackets appear around the formula... then copy down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: If content in column 1 matches, pull all data into one cell separated by a column

    You can put this in the result content worksheet code module (right click the worksheet tab and choose view code)
    Please Login or Register  to view this content.
    Now when an entry is made in column A of that sheet the result will be filled in!


    Google Me
    Find me located here Simon Lloyd
    and what i'm about Here
    The above is NOT a link to a forum so is NOT against Rule 13
    Last edited by Simon Lloyd; 02-02-2012 at 09:04 AM. Reason: missed a line out of code!

+ 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