Subtracting text

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
 
S

Shane Devenshire

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)),"")
 
R

Rick Rothstein

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top