Remove Duplicates in a cell Append formula

Danny54

Active Member
Joined
Jul 3, 2019
Messages
295
Office Version
  1. 365
Platform
  1. Windows
Is there a quick way to remove duplicates in a append formula?


1699284297485.png


When I insert the formula in column E I get duplicates.
=A1 & ", " & B1 & ", " & C1

1699284393433.png


I would like for column E to show Blue,Red for row 1 and Blue,Red,Green for row 2 thus removing the duplicates

Thanks
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
How about
Excel Formula:
=TEXTJOIN(", ",,UNIQUE(A1:C1,1))
 
Upvote 1
Try:
Mr Excel Questions 72.xlsm
ABCD
1
2BlueBlueRedBlue,Red
3BlueRedGreenBlue,Red,Green
4
Danny54
Cell Formulas
RangeFormula
D2:D3D2=TEXTJOIN(",",,UNIQUE(A2:C2,TRUE,FALSE))
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
May I ask how I might handle removing dupes if the cell data looked like this?

1699289248510.png


So column D row 1 would show Blue, Red

It looks like they thow multiple data fields in some of the cells seperated by a comma
 
Upvote 0
How about
Excel Formula:
=TEXTJOIN(", ",,UNIQUE(REDUCE(A1,B1:C1,LAMBDA(x,y,HSTACK(TEXTSPLIT(x,", "),TEXTSPLIT(y,", ")))),1))
 
Upvote 0
I received the same results I'll take your example and work thru it to better understand. I haven't used LAMBDA or HSTACK in the past.
Again Thanks
 
Upvote 0
I was going to offer this until I saw yours:

Excel Formula:
=TEXTJOIN(",",,UNIQUE(TEXTSPLIT(A8:C8,","),TRUE))

But here are the results I received:

Book1
ABCDEFG
8Blue,RedBlueRedBlue,RedBlue,Red, Blue, Red
9BlueRedGreenBlue,Red,GreenBlue, Red, Green
Sheet1
Cell Formulas
RangeFormula
D8:D9D8=TEXTJOIN(",",,UNIQUE(TEXTSPLIT(A8:C8,","),TRUE))
G8:G9G8=TEXTJOIN(", ",,UNIQUE(REDUCE(A8,B8:C8,LAMBDA(x,y,HSTACK(TEXTSPLIT(x,", "),TEXTSPLIT(y,", ")))),1))
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,660
Latest member
Zatman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top