+ Reply to Thread
Results 1 to 8 of 8

How to remove certain names from a cell?

  1. #1
    Registered User
    Join Date
    12-13-2014
    Location
    SC, USA
    MS-Off Ver
    Windows 7
    Posts
    3

    Question How to remove certain names from a cell?

    I need to be able to pull out a few select names from a string of names for each cell in a column. While each cell has a series of names there are only 11 unique names I am looking to post in an additional column and no cell has more than one of these unique names. Is there a formula I can use to do so? Or as an alternative, if a cell has a certain name it remove that name or names and leave the others.

    For example:
    Current List of names:
    Black, Jonny,Rogers, Amber,Brown, Herman
    Johnson, BJ,Stewart, Martha,Rogers, Amber
    Johnson, BJ,Black, Jonny,Rogers, Amber,Long, Jack
    Johnson, BJ,Black,Greeny, Sara,Jonny,Rogers, Amber
    Luther, Leigh,Johnson, BJ,Black, Jonny
    Johnson, BJ,Black, Jonny,Rogers, Amber,Duck, Donald
    Black, Jonny,Rogers, Amber,Brown, Herman
    Black, Jonny,Green, Joe
    Long, Jack,Johnson, BJ,Black, Jonny,Rogers, Amber
    Johnson, BJ,Brown, Herman,Black, Jonny,Rogers, Amber
    Johnson, BJ,Rogers, Amber,Jolin, Charlie
    Johnson, BJ,Black, Jonny,Rogers, Amber,Brown, Herman
    Johnson, BJ,Rogers, Amber,Green, Joe
    Johnson, BJ,Black, Jonny,,Jackson, Sam,Rogers, Amber
    Johnson, BJ,Black, Jonny,Duck, Donald
    Black, Jonny,Rogers, Amber,Luther, Leigh
    Johnson, BJ,Black, Jonny,Rogers, Amber,Long, Jack
    Green, Joe,Johnson, BJ,Black, Jonny,Rogers, Amber
    Johnson, BJ,Black, Jonny,Brown, Herman,Rogers, Amber
    Johnson, BJ,Black, Jonny,Rogers, Amber,Stewart, Martha
    Johnson, BJ,Black, Jonny,Rogers, Amber,Long, Jack
    Black, Jonny,Greeny, Sara


    Names I want removed no matter where they are in the cell:
    Johnson, BJ
    Rogers, Amber
    Black, Jonny

    Unique names I want remaining in a new column:
    Brown, Herman
    Stewart, Martha
    Greeny, Sara
    Duck, Donald
    Green, Joe
    Jolin, Charlie
    Jackson, Sam
    Luther, Leigh
    Long, Jack

    Thanks in advance for helping me save a lot of time!
    Attached Files Attached Files
    Last edited by bethanyjoy10; 12-14-2014 at 01:29 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to remove certain names from a cell?

    Sorry Bethany I don't really understand what you mean by retaining the unique names in another column.

    But a simple Macro will delete the names that you don't want.


    Please Login or Register  to view this content.
    Last edited by mehmetcik; 12-14-2014 at 01:36 AM.

  3. #3
    Forum Contributor
    Join Date
    09-18-2014
    Location
    Pakistan
    MS-Off Ver
    2013, 2016
    Posts
    283

    Re: How to remove certain names from a cell?

    Attach the File

  4. #4
    Registered User
    Join Date
    12-13-2014
    Location
    SC, USA
    MS-Off Ver
    Windows 7
    Posts
    3

    Re: How to remove certain names from a cell?

    I have attached the file as I am familiar with macros to the extent of repetitive actions for formatting etc but not including formulas or scripting such as you have posted above. If you could include it in my sheet I can more than likely look at it and figure out what you mean as i am very familiar with formulas however not as familiar with Macros.

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to remove certain names from a cell?

    Left click on the button to run the macro

    Right click on the button, select assign macro, select edit to view the code:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to remove certain names from a cell?

    If I have interpreted correctly try this non-VBA formula. It works at my end. In B2 enter and fill down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Is this what you wanted?
    Last edited by FlameRetired; 12-15-2014 at 12:23 AM. Reason: misleading cell references

  7. #7
    Registered User
    Join Date
    12-13-2014
    Location
    SC, USA
    MS-Off Ver
    Windows 7
    Posts
    3

    Re: How to remove certain names from a cell?

    This formula worked perfectly. Can you please expalin what 25^25,SEARCH stands for so I know for future. Thanks.

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to remove certain names from a cell?

    Quote Originally Posted by bethanyjoy10 View Post
    This formula worked perfectly. Can you please expalin what 25^25,SEARCH stands for so I know for future. Thanks.
    I'll give it a try. Search SEARCHes for the existence of items in your "keeper" list ($C$2:$C$10); it returns an index or location number

    within the text in question....$A2 in this case. 25^25 is an arbitrarily large number (over the top, really) that insures it will find the

    location number no matter how deep it is in the target text nor how large. It locates the first number less than 25^25. That number

    also has a position within what is called an array. It too has its own implicit location number.....count its position in the array and that

    matches the relative position / row number of a "keeper" item from $C$2:$C$10....which LOOKUP looks up. It then returns

    that item.

    Does that help?
    Last edited by FlameRetired; 12-15-2014 at 06:37 PM.

+ 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. Need to copy store names from sheet1 to sheet3 and remove duplicate names
    By aleanboy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-21-2014, 08:47 AM
  2. Replies: 1
    Last Post: 10-06-2014, 09:44 AM
  3. [SOLVED] Draw random names from list and then remove, carry on till no names left in list
    By dave1983 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-26-2014, 12:14 PM
  4. [SOLVED] Unable to remove names on cell groups for use in drop down lists
    By Allsort in forum Excel General
    Replies: 1
    Last Post: 08-14-2013, 02:00 PM
  5. Replies: 5
    Last Post: 05-21-2010, 04:34 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