+ Reply to Thread
Results 1 to 4 of 4

Finding duplicates and assign the corresponding concatenated values

  1. #1
    Registered User
    Join Date
    08-04-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    Question Finding duplicates and assign the corresponding concatenated values

    Problem: to remove the duplicate values and to assign the corresponding values. Some of the files have more than a 10,000 rows (some of which are duplicates), so not appropriate, rather impossible to do it manually. Is there any formula to use to remove duplicates, combine the corresponding values using separator and compile a table with no duplicates (file attached)?

    For example, for the number 273.185 (in column A) I have 5 corresponding numbers in each of the columns B, C and D. I would like to delete the duplicates in the Column A but to add the corresponding numbers in Columns B, C and D.


    It should look something like:

    Column A | Column B | Column C | Column D
    273.185 | 722286, 699119, 148561, 518520, 289730 | 1344, 4592, 6342, 6702, 9321 | 89, 71, 36, 54, 97

    Any suggestions?

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Finding duplicates and assign the corresponding concatenated values

    One Way... in F2 copied down:
    =IFERROR(INDEX($A$2:$A$41,MATCH(0,INDEX(COUNTIF($F$1:$F1,$A$2:$A$41),0),0)),"")

    The a bit of code...
    Please Login or Register  to view this content.
    How to install your new code
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Press Alt+F11 to open the Visual Basic Editor
    Choose Insert > Module
    Edit > Paste the macro into the module that appeared
    Close the VBEditor
    Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    Then use this array formula in G2, copied across and down:
    =ConcatAll(IF($A$2:$A$41=$F2,B$2:B$41,""),", ")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    08-04-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    8

    Re: Finding duplicates and assign the corresponding concatenated values

    Glenn Kennedy,

    SUPERB!

    Your solution is perfect, for which I am very, very grateful.

    Thank you so much. I learned something new today!

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Finding duplicates and assign the corresponding concatenated values

    You're welcome.

    If it's too slow getting the uniwue values, let me know ....


    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Large function: finding the values of the 3rd and 4th peak with duplicates
    By fionafiona in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 03-16-2017, 08:16 AM
  2. Lookup multiple values concatenated into one cell without duplicates
    By Atul Maskara in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2013, 09:33 AM
  3. Finding Duplicates across Sheets without Exact Values
    By twain101 in forum Excel General
    Replies: 7
    Last Post: 03-16-2012, 01:05 PM
  4. vba to Match concatenated values in concatenated columns
    By bjurick in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2012, 03:45 PM
  5. Finding Duplicates And Totalling Values
    By Rosco88 in forum Excel General
    Replies: 5
    Last Post: 02-25-2010, 12:44 PM
  6. finding values from duplicates
    By bisjom in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-12-2006, 06:51 PM

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