I have a small bit of excel knowledge but I have come across a problem. The sheet I am working with has a column with a list names some of which are duplicated. The next column has a list of attributes for each person where each duplicate has a different attribute IE
- John AA
- John AB
- Eddy AA
- Toni BB
- Toni BC
- Gerry GH
- Gerry YH
- Tom HH
Now what I am trying to do is combine the text in the second column with each duplicate name then delete the duplicates. This sheet might have as many as 500 rows and it is very time consuming joining them by hand. I have been trying to use "concentate" or "&" to join the duplicate rows but I think I need an "IF" statement to check the name first then if it is a duplicate concentate the attributes that match the name.
Can anyone help me with an idea to solve this to save me hours of work. I hope I am describing my problem properly. Eventually I would like to create a macro that will work for me in the future. Thank you for any help you can give.
2 Answers
It isn't clear if you want the duplicate names removed, or the duplicate name & attribute removed, so I will show both.
There is built in functionality to deal with duplicates. Without joining the columns, go to Data->Remove Duplicates->only check the name column->Okay.
Then to combine use something like =name&" "&attribute and drag.
If you want to first combine, then remove duplicates, you can try something like:
=UNIQUE(A1:A10&" "&B1:B10)
First, concatenate the column by using below formula (copy this formula to cell C1):
=CONCAT(A1," ",B1) Then select the the table and press "Remove Duplicates" button. After that there will be papered a dialog box as below. Untick Colum A, Column B and press "OK".
