+ Reply to Thread
Results 1 to 5 of 5

If cell contains text from list, remove text from that cell

  1. #1
    Registered User
    Join Date
    08-08-2019
    Location
    Houston, Texas
    MS-Off Ver
    O365
    Posts
    16

    If cell contains text from list, remove text from that cell

    Hi, I have a list of cells that have countries and names, but I want to remove the countries and just leave the names. I have a list of the countries that I want to remove, I just don't know the formula to say if cell A1 contains text from list of cells D1:D26, remove it from cell A1, and so forth. Attached workbook. Any help is greatly appreciated!

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: If cell contains text from list, remove text from that cell

    in D2

    =IFERROR(SUBSTITUTE($A1,INDEX($C$1:$C$26,SUMPRODUCT(ISNUMBER(FIND($C$1:$C$26,$A1,1))*ROW($1:$26))),""),"")

    "Problem" with "Ireland" and "Nothern Ireland" for 2 cases

  3. #3
    Registered User
    Join Date
    08-08-2019
    Location
    Houston, Texas
    MS-Off Ver
    O365
    Posts
    16

    Re: If cell contains text from list, remove text from that cell

    Thank you!! I will just make Ireland one item and Northern another in that list.

  4. #4
    Forum Contributor
    Join Date
    02-09-2021
    Location
    New York
    MS-Off Ver
    Office 2019
    Posts
    145

    Re: If cell contains text from list, remove text from that cell

    Please try,
    It seems to work.


    =substitute(a1,index($c$1:$c$26,match(a1,$c$1:$c$26,1)),"")





    edit,
    Sorry didn't realize a reply.
    Attached Files Attached Files
    Last edited by D13L; 03-17-2021 at 01:02 PM.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,202

    Re: If cell contains text from list, remove text from that cell

    @D13L

    No need to apologise as your solution works perfectly.

+ 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. [SOLVED] How to remove part of Cell Text if partial text of that Cell is unique
    By robmbaker in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2019, 09:40 AM
  2. [SOLVED] From Cell A2, remove text that is found in Cell B2, and display any remaining text in C2
    By lespaulfan#1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-13-2019, 12:42 PM
  3. Remove Dropdown List if Text in adjacent cell
    By brent_milne in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-17-2014, 05:28 PM
  4. [SOLVED] Search for the text in cell A1 in a list and remove the text if found in the list
    By kak0 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-24-2014, 11:01 PM
  5. Replies: 3
    Last Post: 06-15-2014, 11:31 AM
  6. [SOLVED] Remove Text+Numbers Sometimes, Based on Other Text in Cell
    By eugeniusjr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-29-2013, 11:37 AM
  7. Replies: 2
    Last Post: 01-11-2011, 07:02 AM

Tags for this Thread

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