ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Subtracting text (https://www.excelbanter.com/excel-discussion-misc-queries/234409-subtracting-text.html)

idrabefi

Subtracting text
 
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

joeu2004

Subtracting text
 

"idrabefi" wrote:
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


=left(A1,len(A1)-len(B1))


Gary''s Student

Subtracting text
 
=SUBSTITUTE(A1,B1,"")

--
Gary''s Student - gsnu200857

Max

Subtracting text
 
Try in C1: =SUBSTITUTE(A1,B1,"")
voila? celebrato, click YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"idrabefi" wrote:
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


joeu2004

Subtracting text
 
"Max" wrote:
Try in C1: =SUBSTITUTE(A1,B1,"")


Test with "time to time" in A1 and "time" in B1.


----- original message -----

"Max" wrote in message
...
Try in C1: =SUBSTITUTE(A1,B1,"")
voila? celebrato, click YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"idrabefi" wrote:
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



Max

Subtracting text
 
"JoeU2004" wrote:
Test with "time to time" in A1 and "time" in B1

That's a new question? What was offered earlier does
give the desired results as indicated by the OP.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---

Shane Devenshire[_2_]

Subtracting text
 
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)),"")

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"idrabefi" wrote:

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


Rick Rothstein

Subtracting text
 
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?

--
Rick (MVP - Excel)


"Shane Devenshire" wrote in
message ...
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)),"")

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"idrabefi" wrote:

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




All times are GMT +1. The time now is 12:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com