ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Trim or Extract from a Text Field (https://www.excelbanter.com/excel-discussion-misc-queries/178477-trim-extract-text-field.html)

billbrandi

Trim or Extract from a Text Field
 
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.

Ron Coderre

Trim or Extract from a Text Field
 
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)

"billbrandi" wrote in message
...
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.






All times are GMT +1. The time now is 05:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com