+ Reply to Thread
Results 1 to 6 of 6

Merge data from separate columns

  1. #1
    Registered User
    Join Date
    03-24-2011
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    3

    Merge data from separate columns

    Dear gurus,

    We've been trying here to fight an issue where we can't get to a solution.

    We have a table like:

    A abrf
    B bdkw
    C jfgd
    A jfdk
    E jkfg
    B roer

    (where the single char is column A and the 4 letters are column B)

    The goal was to have in column C the merger of the values in column B for which the value in column A is the same, like:

    abrf-jfdk
    bdkw-roer
    jfgd
    abrf-jfdk
    jkfg
    bdkw-roer

    Can someone give us a hand?

    Highly appreciated.

  2. #2
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Merge data from separate columns

    one way may be to filter a - z on col a and put this in col c

    =IF(A2=A1,B1&" "&B2,B2)
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  3. #3
    Registered User
    Join Date
    03-24-2011
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Merge data from separate columns

    Quote Originally Posted by Blake 7 View Post
    one way may be to filter a - z on col a and put this in col c

    =IF(A2=A1,B1&" "&B2,B2)
    Hi Blake,

    Thank you for your answer.
    Nevertheless, the expectation is that the formula can process n number of similar values in column A, where n is variable.

    Thanks!

  4. #4
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: Merge data from separate columns

    ok - i'll take another look. but could you say if col a will be txt, num or mixture, will there be any dashes?

  5. #5
    Registered User
    Join Date
    03-24-2011
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Merge data from separate columns

    Quote Originally Posted by Blake 7 View Post
    ok - i'll take another look. but could you say if col a will be txt, num or mixture, will there be any dashes?
    Hello,
    It's email addresses.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Merge data from separate columns

    Okay, no one said this would be easy.
    First I created a unique list of values from Column A in Column D starting in D1.
    Then starting in F1 and dragging to the right and then down,

    =IF(COLUMNS($A$1:A1)>COUNTIF($A$1:$A$500,$D1),"",INDEX($B$1:$B$500,SMALL(($A$1:$A$500=$D1)*ROW($A$1:$A$500),COLUMNS($A$1:A$1)+COUNTIF($A$1:$A$500,"<>"&$D1)))) entered as an array (CNTRL SHFT ENTER instead of ENTER)

    That puts all values associated with A in cells in the same row as A (see attachment)

    Now you need to concatenate with dashes. You could do this manually, i.e. in E1
    =F1&"-"&G1&"-"&H1 but that's time consuming.

    Here's a User Defined Function (UDF)
    Please Login or Register  to view this content.
    Then in E1
    =IF(ISBLANK(D1),"",Concat(F1:O1) dragged down.
    How we doing?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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