Search code examples
excelexcel-formulams-office

Excel match text of one cell with another and remove the matching text


I have an excel sheet with two columns, "Brand Name" and "Title". I want to generate a cell that removes the "Brand Name" from the "Title".

How can I achieve this with an excel formula?

I have attached a screenshot of the file.

enter image description here


Solution

  • Using Basic Text Functions

    • You can solve this in many ways. Here are some that use basic Excel functions:

    All Occurrences

    =TRIM(SUBSTITUTE(B1,A1,""))
    

    First Occurrence

    =TRIM(SUBSTITUTE(B1,A1,"",1))
    

    Concatenated Space

    =SUBSTITUTE(B1,A1&" ","",1)
    

    First Space (B-Column Only)

    =RIGHT(B1,LEN(B1)-FIND(" ",B1))
    

    Length + 1 (For the Space): - (LEN(A1) + 1) = - LEN(A1) - 1

    =RIGHT(B1,LEN(B1)-LEN(A1)-1)
    

    Length + 1 (For the Space)

    =REPLACE(B1,1,LEN(A1)+1,"")