简体   繁体   中英

Excel: Remove part of cell (String) based on another cell (String)

I have two columns/cells that look like this:

Column A Column B
Word123 Word1 Word12 Word123 Word1234

My question: How can I remove the "Word123" (value of Column A) inside Column B so that the value of Column B looks like this: Word1 Word12 Word1234

Note that in Column B there is always one space character betweens these values and I have a lot of rows that need this kind of processing.

I have tried using the SUBSTITUTE Function but that doesnt seem to do the trick

Try the following formula-

=LET(x,TEXTSPLIT(B2,," "),TEXTJOIN(" ",1,FILTER(x,COUNTIFS(A2,x)=0)))

在此处输入图像描述

SUBSTITUTE works fine too... But you need to use some extra spaces to separate the strings clearly:

=TRIM(SUBSTITUTE(" " & B1 & " " ; " " & A1 & " " ; " "))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM