+ Reply to Thread
Results 1 to 5 of 5

Comparing Cells + Only displaying unique values.

  1. #1
    Registered User
    Join Date
    01-19-2009
    Location
    UK
    MS-Off Ver
    2007
    Posts
    60

    Question Comparing Cells + Only displaying unique values.

    I'm not sure how to approach this:


    Example 1

    So, I have 4 cells containing names. Imagine cells A1 to D1 containing:

    John | John | Smith | John

    Now, I want cell E1 to compare the cells and neatly display each unique name. So I'd want the value of cell E1 to be:

    John / Smith


    Example 2

    John | John | John | John

    This should result in just "John" in E1


    Example 3

    John | Smith | John | Tomato

    This should result in "John / Smith / Tomato" in E1

    Also, I'd like the names to be in order, so in this third example the result I've shown is what would be expected.

    This isn't too complex, in terms of human logic, but I added some examples just in case it wasn't clear enough to build a function.


    So yeah, awaiting replies, hopefully someone has an efficient solution to this.
    Last edited by AKK9; 09-14-2010 at 08:35 AM. Reason: Solved.

  2. #2
    Registered User
    Join Date
    08-15-2010
    Location
    melbourne, australia
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Comparing Cells + Only displaying unique values.

    is the data just one long column ?

    then this is A bit of indirect approach
    but i guess you could use pivot table ?

    transpose to row first, give header, insert pivot table, and then just drag whatever header you give the data to row labels
    Last edited by vxg; 09-14-2010 at 07:45 AM.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Comparing Cells + Only displaying unique values.

    Add this UDF to your VB editor (Alt + F11, Insert|Module)

    Please Login or Register  to view this content.
    Then in E1 enter formula:

    Please Login or Register  to view this content.
    confirmed with CTRL+SHIFT+ENTER not just ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Comparing Cells + Only displaying unique values.

    If you truly only have 4 cells to compare per group, then even this formula:

    Please Login or Register  to view this content.
    with no UDF or special confirmations.

  5. #5
    Registered User
    Join Date
    01-19-2009
    Location
    UK
    MS-Off Ver
    2007
    Posts
    60

    Re: Comparing Cells + Only displaying unique values.

    Thanks for those quick replies, that last post was the one. It works flawlessly, really appreciate it, NBVC.

    vxg, I also appreciate you taking the time to attempt a solution.

    I'm glad I could learn from you both.

    Topic Solved.
    .
    - AKK9 -

+ 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