ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Deleting duplicates within a column? (https://www.excelbanter.com/excel-discussion-misc-queries/341216-deleting-duplicates-within-column.html)

RMN

Deleting duplicates within a column?
 
If I have, for example:

4,2,,3,2,,,,,,9,9
6,44,,,,,,9,12,6
ee,3,22,22,22,22

and I want to delete the duplicate numbers and commas so that it looks like:

4,2,3,9
6,44,9,12
ee,3,22


Is there a way to do this and apply it to an entire column? There are nearly 10,000 rows in this column and they are all different, so it will be very time-consuming to do it by hand.

Thanks a lot! :D

RMN

In case anyone has this question in the future, I figured out a way:

Select the entire column and go to Data--text to columns--Delimited, and select the appropriate separators (in this case, commas and spaces). This will put each number in its own cell.

Use:
=IF(COUNTIF($A1:A1,A1)=1, A1,"")

Drag it over to the right as many columns as necessary, and then drag it down as many rows as necessary. Any duplicates will be blank.

Select all of them, copy, paste special, "values."

Use MCONCAT to combine them again and voila! :D


All times are GMT +1. The time now is 04:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com