Trimming/Truncating Text Field in Excel

B

billbrandi

I have a file with 3 text columns that I am using as a mailing list. I want
to remove the leading 5 characters from each text field and the trailing 10
characters from the same fields. How would I do this?
 
R

Rick Rothstein \(MVP - VB\)

Try this:
A1 = 12345xxx1234567890

=MID(LEFT(A1,LEN(A1)-10),6,255)

returns xxx

Another way...

=REPLACE(REPLACE(A1,LEN(A1)-9,10,""),1,5,"")

It is Saturday and things are slow... I was bored.<g>

Rick
 
R

Rick Rothstein \(MVP - VB\)

Try this:
A1 = 12345xxx1234567890

=MID(LEFT(A1,LEN(A1)-10),6,255)

returns xxx

In thinking about it a little more, this is probably the more efficient way
to use the MID function to do what the OP asked for...

=MID(A1,6,LEN(A1)-15)

Rick
 
Top