+ Reply to Thread
Results 1 to 4 of 4

Method to Concatenate Columns if there are duplicate entries in Rows

Hybrid View

  1. #1
    Registered User
    Join Date
    12-01-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    17

    Unhappy Method to Concatenate Columns if there are duplicate entries in Rows

    Dear All,

    My source table looks like below:

    Title Area Category
    Finance Risk Finance Budget
    Finance Risk Finance Spend
    Finance Risk Finance Cost
    IT System IT Process
    IT System IT Governance


    But since there are multiple 'categories' attached with single Risk, I have to convert them like this for all duplicate values except the 3rd column as below:

    Title Risk Category
    Finance Risk Finance Budget / Spend / Cost
    IT System IT Process / Governance

    Any help would be tremendously appreciated.. I am struggling to get an idea on this....

    Thanks,
    Navaneeth

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Method to Concatenate Columns if there are duplicate entries in Rows

    This presumes your data is sorted the way you demonstrated... if it is not, then sort the data by column A, then column B.

    1) Put this formula in D2:

    =A2&"-"&B2

    2) In E2:

    =IF(AND(A2=A3, B2=B3), D3 & " / " & C2, C2)

    3) In F2:

    =IF(COUNTIF($D$2:$D2, $D2) = 1, E2, "")

    4) Now copy those three cells downward.

    5) Highlight column F, and copy it

    6) Click on column C and do an Edit > Paste Special > Values to paste the new values over the old

    7) Clear columns D:F

    8) Highlight column C and turn on the Data > Filter (AutoFilter)

    9) Use the drop down to filter the column for Blanks

    10) Highlight all the visible rows and delete them

    11) Turn off the Data > Filter (AutoFilter)
    Last edited by JBeaucaire; 02-13-2012 at 07:07 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-01-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: Method to Concatenate Columns if there are duplicate entries in Rows

    Hi JBeaucaire,

    I tried your comment, but it gives error during this step =IF(COUNTIF($D$2:$D2, $D2) = 1, E2, "") - #Value! error. Any idea why that might be?

    Thanks
    Navaneeth.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Method to Concatenate Columns if there are duplicate entries in Rows

    No, show us where you put it in. Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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