Unique values from column where cells have multiple values with a delimiter

ausswe

New Member
Joined
Feb 19, 2013
Messages
35
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi,
I've been sourcing around to figure out how to use a formula to get a unique list with values in a column where some cells have multiple values in the same cell with "; " as a delimiter between them. Would anyone have any ideas?

Example:

A (unique values from B)B
Sarskild boendeformSarskild boendeform; Trygghetslarm; Boendestod; Matdistribution
TrygghetslarmMatdistribution
BoendestodSarskild boendeform; Trygghetslarm; Matdistribution
MatdistributionTrygghetslarm
Boendestod; Matdistribution
Sarskild boendeform
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Microsoft 365 Apps for enterprise, subscription. Build 2208.
 
Upvote 0
Microsoft 365 Apps for enterprise, subscription. Build 2208.

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Hi,
I've been sourcing around to figure out how to use a formula to get a unique list with values in a column where some cells have multiple values in the same cell with "; " as a delimiter between them. Would anyone have any ideas?

Example:

A (unique values from B)B
Sarskild boendeformSarskild boendeform; Trygghetslarm; Boendestod; Matdistribution
TrygghetslarmMatdistribution
BoendestodSarskild boendeform; Trygghetslarm; Matdistribution
MatdistributionTrygghetslarm
Boendestod; Matdistribution
Sarskild boendeform
enter the following formula:

=UNIQUE(FILTERXML("<root><s>"&SUBSTITUTE(A:A,"; ","</s><s>")&"</s></root>","//s")
 
Upvote 0
Have you actually tried that formula? If so how long did it take?
 
Upvote 0
How about
Fluff.xlsm
AB
1
2Sarskild boendeformSarskild boendeform; Trygghetslarm; Boendestod; Matdistribution
3TrygghetslarmMatdistribution
4BoendestodSarskild boendeform; Trygghetslarm; Matdistribution
5MatdistributionTrygghetslarm
6Boendestod; Matdistribution
7Sarskild boendeform
8
Main
Cell Formulas
RangeFormula
A2:A5A2=UNIQUE(TEXTSPLIT(TEXTJOIN("; ",,B2:B100),,"; "))
Dynamic array formulas.
 
Upvote 0
Try using the below :

Book2
AB
1Sarskild boendeformSarskild boendeform; Trygghetslarm; Boendestod; Matdistribution
2TrygghetslarmMatdistribution
3BoendestodSarskild boendeform; Trygghetslarm; Matdistribution
4MatdistributionTrygghetslarm
5Boendestod; Matdistribution
6Sarskild boendeform
Sheet1
Cell Formulas
RangeFormula
A1:A4A1=UNIQUE(TRIM(TEXTSPLIT(TEXTJOIN(";",,B1:B6),,";")))
Dynamic array formulas.
 
Upvote 0
Thanks all, so option 1 (UNIQUE(FILTERXML("<root><s>"&SUBSTITUTE(A:A,"; ","</s><s>")&"</s></root>","//s")) seems to work, took around 1 minute to calculate with my data and it returned a #VALUE in the middle of the list of values it created, I tried to set the format to General but that didn't help the issue.

Option 2 (UNIQUE(TRIM(TEXTSPLIT(TEXTJOIN(";",,B1:B6),,";")))) returns an #CALC! error saying the function returned text that was longer than the maximum supported length.
 
Upvote 0
option 1 (UNIQUE(FILTERXML("<root><s>"&SUBSTITUTE(A:A,"; ","</s><s>")&"</s></root>","//s")) seems to work
It might appear to work, but it doesn't. It will only return the 1st word from each cell.
Option 2 (UNIQUE(TRIM(TEXTSPLIT(TEXTJOIN(";",,B1:B6),,";")))) returns an #CALC! error saying the function returned text that was longer
How many rows of data do you have?
 
Upvote 0

Forum statistics

Threads
1,215,140
Messages
6,123,269
Members
449,093
Latest member
Vincent Khandagale

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