+ Reply to Thread
Results 1 to 3 of 3

removing duplicates in a string of text

  1. #1
    Registered User
    Join Date
    04-05-2006
    Posts
    15

    removing duplicates in a string of text

    Hi Everyone,

    I need your help! I have a spreadsheet that contains 1-3 email addresses in a single cell separated by a semi-colin. Some of the email addresses are duplicated. Is there a formula/function that can look at the email addresses in the cell, and return the email addresses removing the duplicates?

    I have attached a sample document with my desired outcome.

    Thanks in advance for the help,
    Julie
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by zapszipszops
    Hi Everyone,

    I need your help! I have a spreadsheet that contains 1-3 email addresses in a single cell separated by a semi-colin. Some of the email addresses are duplicated. Is there a formula/function that can look at the email addresses in the cell, and return the email addresses removing the duplicates?

    I have attached a sample document with my desired outcome.

    Thanks in advance for the help,
    Julie
    One solution would be to do it in two stages.

    First convert the single cell to 3 cells with the Text to Columns functionality, specifying the ; as the delimiter.

    Then in a fourth column, rebuild the cell with some nested If() functions which test the values of the 3 cells for duplicates and re-building the string as appropriate. You'll definitely need the first cell in the rebuilt string, so it's just a case of checking whether cells 2=1, or 3=1, or 2=3 and building the formula accordingly.

    HTH

    Hope this helps

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Say your data as shown is in the range A1:A3.

    Create a general module in your spreadsheet (alt F11, insert, module) and input the code

    Please Login or Register  to view this content.
    In B1 enter the formula
    =myfunc(A1)
    and copy down to B3.

    HTH

    rylo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1