Subtracting text

  • Thread starter Thread starter idrabefi
  • Start date Start date
I

idrabefi

Can anyone offer help subtracting the contents of 1 cell's text from another?
This is basically a reverse =CONCATENATE() question.

Ex: Cell A1 = ABCDEFG
Cell B1 = FG
formula results desired for A1-B1 = ABCDE
 
Hi,

You have some solutions but the problem is your question in not clear. Are
you trying to "subtract" FG because it is at the end to of the string in A1
or are you trying to remove it wherever it is?

The SUBSTITUTE approach removes all occurances of it:

=SUBSTITUTE(A1,A2,)

If you want to remove the characters on the right and you know they will be
what is in FG then you use the other approach shown. If you want to remove
the right-hand characters IF they match A2 then

=IF(RIGHT(A1,LEN(A2))=A2,LEFT(A1,LEN(A1)-LEN(A2)),"")
 
The OP needs to clarify one other thing... is FG supposed to be considered a
single "word" to be deleted? Or does he want all F's and all G's removed
whether they appear next to each other or not?
 
Back
Top