Combine multiple cells with unique A and different B's into one cell

Created by Art Bryman, Modified on Mon, 7 Oct, 2024 at 6:01 PM by Art Bryman

Combine multiple cells with unique A and different B's into one cell : r/excel (reddit.com)


Goal: combine items that have duplicates in column A and different values in Column B, to get one value of Column A and column B to be a list of unique items in columns B which had duplicate value A as a match.

r/excel - Combine multiple cells with unique A and different B's into one cell


  1. Column A will be the unique value in column D
  2. Values in column B will be joined together in column E, for every value in D/A
  3. Copy relevant columns to new worksheet with headers
  4. Put "=unique(A:A) in D1, and it will autofill column D
  5. Put "=TEXTJOIN(",",TRUE,TRANSPOSE(FILTER(B:B,A:A=D2)))" in E2
  6. Copy columns D and E, and paste as values.
  7. In the original worksheet, use VLOOKUP(A2,NewWorksheet!$D:$E,2,0)
    1. A2 should be the same as columns A/D
    2. This will copy the merged values into the original worksheet
  8. Remove the original column B from the original worksheet
  9. Use "Remove Duplicates" to remove duplicate rows.

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article