+ Reply to Thread
Results 1 to 14 of 14

Name List Help

  1. #1
    Registered User
    Join Date
    04-09-2016
    Location
    New York, New York
    MS-Off Ver
    2013
    Posts
    12

    Name List Help

    I have two lists in columns A + B. All of the values of A are in B, however, B is unique from are. Essentially A is a subset of B.

    I'm doing how I can identify unique values that do not come up twice.

    For instance:

    A (list)
    Sam Hunt
    Joe Smith


    B (all names)
    Sam Hunt
    Joe Smith
    Carrie Underwood
    Mike Fisher

    C (Unique names)
    Carrie Underwood
    Mike Fisher


    I would like this to work so that Column C has all the unique values of B.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Name List Help

    In other words, you want the names from B that do not appear in A?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Name List Help

    Try this...

    Data Range
    A
    B
    C
    1
    Some Names
    All Names
    Not in A
    2
    Sam Hunt
    Sam Hunt
    Carrie Underwood
    3
    Joe Smith
    Joe Smith
    Mike Fisher
    4
    Carrie Underwood
    5
    Mike Fisher
    6


    This array formula** entered in C2:

    =IFERROR(INDEX(B:B,SMALL(IF(ISNA(MATCH(B$2:B$5,A$2:A$3,0)),ROW(B$2:B$5)),ROWS(C$2:C2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

  4. #4
    Registered User
    Join Date
    04-09-2016
    Location
    New York, New York
    MS-Off Ver
    2013
    Posts
    12

    Re: Name List Help

    Hmm it's not working..

    New Approach..


    Is there anyway to remove anything that appears twice on a list not just the "duplicate"

    For Example:

    John Smith
    John Smith
    Carrie Underwood
    Mike Fisher
    Mike Fisher
    John Doe

    I have a column about 600 rows x 1 column in length. I want to get rid of all the doubled values. I would just want the following below on my list. This is small scale however I want to apply it to a much larger list! Not just get rid of the duplicate

    Carrie Underwood
    John Doe

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Name List Help

    Do you want to delete the entire row of data that contains duplicates?

  6. #6
    Registered User
    Join Date
    04-09-2016
    Location
    New York, New York
    MS-Off Ver
    2013
    Posts
    12

    Re: Name List Help

    Yes, I want to delete anything that appears twice and keep anything that appears once.

    Using the "duplicate" function would not help as I want to totally get rid of any name that pops up twice. These values are not unique to my study.

  7. #7
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Name List Help

    If you want to delete rows, then you could use this macro...

    Three things:
    1. List is in column A with a hearder row
    2. Uses column B to filter the results (with a header row)
    3. Deletes rows which have more than one result


    Please Login or Register  to view this content.
    Paste code in a Normal module
    • Where to paste code
    • Highlight macro to copy >> Ctrl + C >> Open your workbook
    • Alt + F11 >> opens the Visual Basic Editor (VBE)
    • Ctrl + R >>opens the Project Explorer (if not already open on left side of screen)
    • Insert menu >> Module or Alt + I, M >> activates the Insert menu and inserts a Standard Module
    • Paste code >> Ctrl + V (right side of screen)
    • Alt + Q >> exits VBE and returns to Excel
    • Back in Excel >> Alt + F8 >> Macro Dialog Box >> Highlight macro >> Run

    NOTE: Please test on a copy of your data for testing purposes...
    Last edited by jeffreybrown; 05-29-2016 at 09:37 AM.
    HTH
    Regards, Jeff

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Name List Help

    Jeff's macro does it pretty much the same way I'd do it manually.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Name List Help

    Here are a couple of array formulae that will do what you want. Enter with Ctrl + Shift + Enter
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Name List Help

    Quote Originally Posted by newdoverman View Post
    =IFERROR(INDEX(B:B,SMALL(IF(ISNA($A$1:$A$2*$B$1:$B$4),ROW($B$1:$B$4)-MIN(ROW($B$1:$B$4))+1),ROWS($1:1))),"")

    =IFERROR(INDEX(B:B,SMALL(IF(ISNA($A$1:$A$2*$B$1:$B$4),ROW($B$1:$B$4),""),ROW())),"")
    Those will return incorrect results if the data is in a different order...

    Data Range
    A
    B
    1
    Sam Hunt
    Carrie Underwood
    2
    Joe Smith
    Mike Fisher
    3
    Sam Hunt
    4
    Joe Smith

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Name List Help

    @Tony
    You're right. Its taking the last values only regardless of the order.

    I don't know if I have a screwed up worksheet but I am getting incorrect results with your formula too...I hope that it is a screwed up worksheet as I don't see why it isn't working...it has been a long day.


    A
    B
    C
    2
    Sam Hunt
    Joe Smith
    Carrie Underwood
    3
    Joe Smith
    Carrie Underwood
    Sam Hunt
    4
    Sam Hunt
    Mike Fisher
    5
    Mike Fisher
    Last edited by newdoverman; 05-29-2016 at 05:48 PM.

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Name List Help

    Here is one way to do this. Use column C as a helper column with this formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then in column D enter this array formula and fill down (Enter with Ctrl + Shift + Enter) All the values with 0 beside them will be returned.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    A
    B
    C
    D
    1
    Sam Hunt
    Joe Smith
    1
    Carrie Underwood
    2
    Joe Smith
    Carrie Underwood
    0
    Mike Fisher
    3
    Sam Hunt
    1
    4
    Mike Fisher
    0

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Name List Help

    Here's a small sample file that demonstrates this.
    Attached Files Attached Files

  14. #14
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Name List Help

    Nice one Tony! My worksheet must have been messed up when I tried it. It works like a charm.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-22-2015, 11:40 AM
  2. Replies: 3
    Last Post: 04-22-2014, 03:30 PM
  3. Replies: 0
    Last Post: 01-09-2013, 11:44 AM
  4. [SOLVED] Taking a list of tasks and a list of subtasks and creating a new list with groupings
    By kknb0800 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-06-2012, 12:16 PM
  5. Replies: 3
    Last Post: 07-20-2012, 09:52 AM
  6. [SOLVED] list 1 has 400 names List 2 has 4000. find manes from list 1 on 2
    By Ed in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 09:05 PM
  7. [SOLVED] list 1 has 400 names List 2 has 4000. find manes from list 1 on 2
    By Max in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 08:05 PM

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