#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default Delete a string

I have a long list of numbers taht all look similar to this M7885/2-4-02_- x
2 andI want to remove everything from the _ to the end. I think I want to use
Find, Replace and Length in a formula to get only the first part. One thing
is the length varies behin the _.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default Delete a string

You can do 2 things..

1) Find, enter "_*" without the quote , Replace, leave the space blank.
Replace All

The * will remove everything after _

Or, to make it a formula, =LEFT(A2,FIND("_",A@)-1) and drag to bottom


"Joe Gieder" wrote:

I have a long list of numbers taht all look similar to this M7885/2-4-02_- x
2 andI want to remove everything from the _ to the end. I think I want to use
Find, Replace and Length in a formula to get only the first part. One thing
is the length varies behin the _.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Delete a string

If you want to show everything in front of the underbar in a different
column, you can use this formula...

=LEFT(A1,FIND("_",A1)-1)

If you want to physically modify the existing entry, you will need a VBA
macro for that.

--
Rick (MVP - Excel)


"Joe Gieder" wrote in message
...
I have a long list of numbers taht all look similar to this M7885/2-4-02_-
x
2 andI want to remove everything from the _ to the end. I think I want to
use
Find, Replace and Length in a formula to get only the first part. One
thing
is the length varies behin the _.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Delete a string

Try this:

=LEFT(A1,FIND("_",A1)-1)

Hope this helps.

Pete

On Oct 3, 6:37*pm, Joe Gieder
wrote:
I have a long list of numbers taht all look similar to this M7885/2-4-02_- x
2 andI want to remove everything from the _ to the end. I think I want to use
Find, Replace and Length in a formula to get only the first part. One thing
is the length varies behin the _.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Delete a string



"Joe Gieder" wrote:

I have a long list of numbers taht all look similar to this M7885/2-4-02_- x
2 andI want to remove everything from the _ to the end. I think I want to use
Find, Replace and Length in a formula to get only the first part. One thing
is the length varies behin the _.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Delete a string

Hi,

This will leave the text you want in the existing column

Data|Text to columns
Select delimited
Next
Check 'Other' and enter an underscore in the 'other' box
Finish

If you don't want to keep the trailing bit then delete the column.

Mike

"Joe Gieder" wrote:

I have a long list of numbers taht all look similar to this M7885/2-4-02_- x
2 andI want to remove everything from the _ to the end. I think I want to use
Find, Replace and Length in a formula to get only the first part. One thing
is the length varies behin the _.

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
delete a - if it is the last part of a string deb Excel Discussion (Misc queries) 1 September 21st 08 01:18 AM
DELETE ROWS FROM XLS IF THE ROW CONTAINS THE STRING [email protected] Excel Discussion (Misc queries) 1 September 30th 06 01:21 PM
Use a formula to delete part of a text string? Josh Craig Excel Worksheet Functions 4 June 29th 06 08:19 AM
can I delete the 1st number from a string of numbers Jessica Excel Discussion (Misc queries) 3 February 9th 06 03:32 AM
Delete carrots in a string [email protected] Excel Worksheet Functions 2 November 9th 04 02:10 AM


All times are GMT +1. The time now is 01:53 AM.

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

About Us

"It's about Microsoft Excel"