Return only unique values, deliminated

jimbomcmucka

New Member
Joined
Oct 11, 2022
Messages
26
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Firstly, thanks so much for those that have helped with a few questions I have had over the last few days! I feel like I have been on here pestering you guys a LOT!
I am hoping this will be my final question (for now)..

I have a data source that lists multiple countries in a single cell, deliminated with a "|". Eg. "CostaRica|Brazil|Mexico|Chile|Netherlands|UnitedKingdom|Ireland|Russia". Sometimes a country will appear twice in this data.

I am returning this value in a simple VLOOKUP ( =VLOOKUP(A4,'Sheet1'!H:O,8,1) ).

Is there a way that I can return only the unique countries? So for example if the data source was ""CostaRica|Brazil|Mexico|CostaRica", remove the duplicate and return ""CostaRica|Brazil|Mexico".

Thanks in advance!
Jim
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
If the data is joined like this in the source, you can remove duplicates like this:
Excel Formula:
=TEXTJOIN("|",TRUE,UNIQUE(TEXTSPLIT(A1,",","|")))
 
Upvote 1
Solution

Forum statistics

Threads
1,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

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