+ Reply to Thread
Results 1 to 5 of 5

How do I remove cell contents if it exists in another cell?

Hybrid View

  1. #1
    Registered User
    Join Date
    08-19-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    37

    How do I remove cell contents if it exists in another cell?

    For example:

    Cell A1 has:
    Peter is walking his dog
    Cell B1 has:
    walking his dog

    preferably how can I remove the "walking his dog" from cell A1

    or to create a new cell which contains "Peter is"

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How do I remove cell contents if it exists in another cell?

    Try this
    in C1
    Formula: copy to clipboard
    =SUBSTITUTE(A1,B1,"")

    v A B C
    1 Peter is walking his dog walking his dog Peter is
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: How do I remove cell contents if it exists in another cell?

    Hi,

    You can do this:

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    1
    Peter is walking his dog walking his dog Peter is
    2
    Paul is feeding his cat playing with his cat
    3
    Paul is playing with his cat Paul is playing with his cat
    Sheet: Sheet41

    Excel 2016 (Windows) 64 bit
    C
    1
    =IF(ISNUMBER(SEARCH(B1,A1)),TRIM(SUBSTITUTE(A1,B1,"")),"")
    Sheet: Sheet41

    Formula copied down.

  4. #4
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: How do I remove cell contents if it exists in another cell?


  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: How do I remove cell contents if it exists in another cell?

    Please do not post duplicate threads. Your other thread has been closed so you can continue here

    Thanks
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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: 4
    Last Post: 07-13-2015, 10:11 AM
  2. macro to copy cell contents then remove substring of contents in new cell - Help
    By three_jeeps in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-25-2015, 01:19 AM
  3. Formula to remove contents of one cell from another cell
    By LightingPop in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-21-2013, 12:23 PM
  4. VBA to use cell contents to loop through folder to see if filename exists
    By bdunphy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2013, 11:15 AM
  5. [SOLVED] How to remove date in one cell when another cell's contents are cleared.
    By jm263 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2013, 08:22 PM
  6. Need to remove some contents of a cell.
    By davidbeaton in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-23-2008, 04:51 PM
  7. Replies: 1
    Last Post: 07-01-2005, 10:57 AM

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