Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing characters

Status
Not open for further replies.

MJD1

Technical User
Joined
Jul 18, 2003
Messages
134
Location
CA
I have a column with multiple rows in an excel sheet. Each row contains text such as "str1111", "str1112" ect. I need to remove the first three characters "str". is there a method or function that can do this for me automatically instead of going thru 100+ rows?

thx
martin
 
You can use something like:

=REPLACE($A:$A,1,3,"")


TomCologne
 
To remove "str" no matter where in the cell it is found, use the Edit...Replace menu item
1) Select the cells you want to go through
2) Open the Edit...Replace menu item
3) Enter str in the Find field and leave the Replace field blank. Click "Replace All"

To remove the first three characters (no matter what they might be), you can use the Text to Columns menu item
1) Select the cells you want to split
2) Open the Data...Text to Columns menu item
3) Choose Fixed Width text, then click "Next" button
4) Click between character three and four in the next dialog, then click the "Next" button
5) The first column should be selected. Choose "Do not import column (skip)" from the option buttons on the right. Click "Finish"

To remove the first three characters only if they are str:
1) Put something like the following formula in a blank column:
=IF(LEFT(A1,3)="str",MID(A1,4,99),A1)
This formula is case insensitive.
2) Copy this formula down
3) Copy the cells containing this formula
4) Select the original data and Edit...Paste Special...Values
5) Clear the cells containing the formula by selecting them and using the Edit...Clear Contents menu item

Brad
 
brad, thank you very much, your option 3 was exactly was I was looking for!

worked like a charm!

Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top