Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Deleting certain string within the string

I have two colums. First column contains a product code and second contains
product code and some description. However I don't need product code in this
other column anymore. How am I able delete just this code string from other
column.

--
-Sam
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Deleting certain string within the string

Hi Sam,

I have two colums. First column contains a product code and second
contains product code and some description. However I don't need
product code in this other column anymore. How am I able delete just
this code string from other column.


There are different ways to do this. Pls. post some examples. Has your
product code a fixed length? Is there a blank between product code and
description, if yes, is it the first blank of the text? Is your code
natural language or only digits ...

arno

  #3   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default Deleting certain string within the string

Yes, here is some additional information.

Code is something like this "SKL190A" or "SKL190", so it can be six or seven
marks long. Other column contains something like this "SKL190A Input
device..."
There is a blank between code and description.

"arno" wrote:

Hi Sam,

I have two colums. First column contains a product code and second
contains product code and some description. However I don't need
product code in this other column anymore. How am I able delete just
this code string from other column.


There are different ways to do this. Pls. post some examples. Has your
product code a fixed length? Is there a blank between product code and
description, if yes, is it the first blank of the text? Is your code
natural language or only digits ...

arno


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Deleting certain string within the string

Hi Sam,

so it can be six
or seven marks long.

....
There is a blank between code and description.


then your formula for a code+text in B1 is:
=RIGHT(B1,LEN(A1)-FIND(" ",B1))

This formula searches for the first blank in the text and takes
everything from there to the end of the string (you have to know how
long your string is (LEN), at which position the blank is (FIND) - then
you know how many characters you have to take from the right end of the
text (RIGHT)).

Do NOT use other functions (eg. trim) to manipulate the resulting
string unless it is absolutely neccessary! E. g. there could be a
reason for blanks to be where they are.

arno


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Deleting certain string within the string

sorry:

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Deleting certain string within the string

Hi,

One possibility:

Assume A1=1234 (Product Code)
B1=1234 ABCD.....(Product Code plus Description

Then in C1 put '=TRIM(REPLACE(TRIM(B1),1,LEN(TRIM(A1)),""))' (without single
quotes). this will leave ABCD in C1.

Copy the formula down column C as required.

HTH

"Sam" wrote:

I have two colums. First column contains a product code and second contains
product code and some description. However I don't need product code in this
other column anymore. How am I able delete just this code string from other
column.

--
-Sam

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Deleting certain string within the string

That will work AS LONG AS the product code is not also found in the
description, e.g.

A1=12 (Product Code)
B1=12 Package of 120 nuts and bolts (Product Code plus Description)

will produce undesirable results ("Package of 0 nuts and bolts"). If the
product code is always in a specific location of the description string
(beginning, end, etc.), you may be able to use the Left(), Right() or Mid()
functions to strip the code.


"Toppers" wrote:

Hi,

One possibility:

Assume A1=1234 (Product Code)
B1=1234 ABCD.....(Product Code plus Description

Then in C1 put '=TRIM(REPLACE(TRIM(B1),1,LEN(TRIM(A1)),""))' (without single
quotes). this will leave ABCD in C1.

Copy the formula down column C as required.

HTH

"Sam" wrote:

I have two colums. First column contains a product code and second contains
product code and some description. However I don't need product code in this
other column anymore. How am I able delete just this code string from other
column.

--
-Sam

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Deleting certain string within the string

Charlie,

SUBSTITUTE has a fourth parameter that can be used to select which instance
to replace.

HTH,
Bernie
MS Excel MVP


"Charlie" wrote in message
...
That will work AS LONG AS the product code is not also found in the
description, e.g.

A1=12 (Product Code)
B1=12 Package of 120 nuts and bolts (Product Code plus Description)

will produce undesirable results ("Package of 0 nuts and bolts"). If the
product code is always in a specific location of the description string
(beginning, end, etc.), you may be able to use the Left(), Right() or

Mid()
functions to strip the code.


"Toppers" wrote:

Hi,

One possibility:

Assume A1=1234 (Product Code)
B1=1234 ABCD.....(Product Code plus Description

Then in C1 put '=TRIM(REPLACE(TRIM(B1),1,LEN(TRIM(A1)),""))' (without

single
quotes). this will leave ABCD in C1.

Copy the formula down column C as required.

HTH

"Sam" wrote:

I have two colums. First column contains a product code and second

contains
product code and some description. However I don't need product code

in this
other column anymore. How am I able delete just this code string from

other
column.

--
-Sam



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Deleting certain string within the string

Charlie,
Try you query .. you get" Package of 120 nuts and bolts" as it
only takes the length of A1 from the front of the combined Product +
description. It does NOT remove 12 from the 120. This REPLACE does work the
same as the VBA replace.






"Charlie" wrote:

That will work AS LONG AS the product code is not also found in the
description, e.g.

A1=12 (Product Code)
B1=12 Package of 120 nuts and bolts (Product Code plus Description)

will produce undesirable results ("Package of 0 nuts and bolts"). If the
product code is always in a specific location of the description string
(beginning, end, etc.), you may be able to use the Left(), Right() or Mid()
functions to strip the code.


"Toppers" wrote:

Hi,

One possibility:

Assume A1=1234 (Product Code)
B1=1234 ABCD.....(Product Code plus Description

Then in C1 put '=TRIM(REPLACE(TRIM(B1),1,LEN(TRIM(A1)),""))' (without single
quotes). this will leave ABCD in C1.

Copy the formula down column C as required.

HTH

"Sam" wrote:

I have two colums. First column contains a product code and second contains
product code and some description. However I don't need product code in this
other column anymore. How am I able delete just this code string from other
column.

--
-Sam

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Deleting certain string within the string

... should have said does NOT work like VBA.

"Toppers" wrote:

Charlie,
Try you query .. you get" Package of 120 nuts and bolts" as it
only takes the length of A1 from the front of the combined Product +
description. It does NOT remove 12 from the 120. This REPLACE does work the
same as the VBA replace.






"Charlie" wrote:

That will work AS LONG AS the product code is not also found in the
description, e.g.

A1=12 (Product Code)
B1=12 Package of 120 nuts and bolts (Product Code plus Description)

will produce undesirable results ("Package of 0 nuts and bolts"). If the
product code is always in a specific location of the description string
(beginning, end, etc.), you may be able to use the Left(), Right() or Mid()
functions to strip the code.


"Toppers" wrote:

Hi,

One possibility:

Assume A1=1234 (Product Code)
B1=1234 ABCD.....(Product Code plus Description

Then in C1 put '=TRIM(REPLACE(TRIM(B1),1,LEN(TRIM(A1)),""))' (without single
quotes). this will leave ABCD in C1.

Copy the formula down column C as required.

HTH

"Sam" wrote:

I have two colums. First column contains a product code and second contains
product code and some description. However I don't need product code in this
other column anymore. How am I able delete just this code string from other
column.

--
-Sam



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change 3 letter text string to a number string Pete Excel Discussion (Misc queries) 3 December 31st 07 07:47 PM
Deleting numbers in a string Cheri Excel Discussion (Misc queries) 5 June 19th 07 10:12 PM
Deleting Columns with String scott Excel Programming 2 January 21st 05 10:17 PM
deleting extra spaces in a string Eric[_16_] Excel Programming 6 December 3rd 03 10:50 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


All times are GMT +1. The time now is 10:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"