Trim or Extract from a Text Field

  • Thread starter Thread starter billbrandi
  • Start date Start date
B

billbrandi

Within Excel, how do I either trim the characters in a text field or extract
characters? I have a field that is in the xxxxxxyyyyxxxxx format and need
only the yyyy portion.
 
With in cell A1

If you want to extract those yyyy characters using a formula....

try this:
B1: =MID(A1,7,4)

OR...you could use Text-to-Columns:

Select the single column range of values (eg: A1:A10)
From the Excel Main Menu:
<data><text-to-columns>
Check: Fixed Width
Click [Next]
Insert break points before and just after the yyyy chars (by clicking)
Click [Next]
Select the 1st column.....Click: Do not import column
Select the 3rd column.....Click: Do not import column

Then....you have a decision:
To trim the excess characters from the actual cells...Click [Finish]

To extract the yyyy chars to another location:
Set the Destination cell (eg B1)....Click [Finish]

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Variable Find 1
Access Access anti-trim?? 0
A Simple Trim 6
Extract portion of a cell 4
second word in a string 3
Extract from the beginning of a text string 2
sort 1
Using IF to selectively trim cell content 1

Back
Top