concensure

Data cleaning

List Unique Characters in a Spreadsheet Cell

Remove duplicate tokens from a comma-separated cell while preserving the order of their first appearance.

Historical topic published by Casper Wu.

Keep the original values

Copy your source column before cleaning it. For a cell containing A, B, A, C, decide whether spaces are meaningful and whether each comma separates a value.

Split and deduplicate

In modern Excel, use =IF(A2="","",LET(items,TRIM(TEXTSPLIT(A2,,",",TRUE)),UNIQUE(items))) to list the first occurrence of each token down the sheet. For the example list, the result should be A, B, C.

Return the result to one cell

With the unique list spilling from B2, use =TEXTJOIN(", ",TRUE,B2#) to rebuild a tidy string. For repeatable imports, keep the steps in Power Query and refresh them when the source changes.

Historical article listing on LinkedIn