Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dailygluttony
 
Posts: n/a
Default How do you truncate a text string?


Hello,

I was wondering if there's a function that allows me to chop characters
of a fixed length off of text strings of varying lengths. For example,
if I have the following strings:

12345-ABC
123456-DEF

I want to be able to cut off the "-ABC" or the "-DEF" and be left with

12345
123456

Normally, I would simply use an =LEFT to capture the part I need, but
since the part before the dash is of varying lengths, I'm not sure how
to do this. Any help would be appreciated.

Thanks!


--
dailygluttony
------------------------------------------------------------------------
dailygluttony's Profile: http://www.excelforum.com/member.php...o&userid=32907
View this thread: http://www.excelforum.com/showthread...hreadid=527259

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
jeffstew1
 
Posts: n/a
Default How do you truncate a text string?

Try This:

=LEFT(A1,FIND("-",A1,1)-1) where A1 is your text.

"dailygluttony" wrote:


Hello,

I was wondering if there's a function that allows me to chop characters
of a fixed length off of text strings of varying lengths. For example,
if I have the following strings:

12345-ABC
123456-DEF

I want to be able to cut off the "-ABC" or the "-DEF" and be left with

12345
123456

Normally, I would simply use an =LEFT to capture the part I need, but
since the part before the dash is of varying lengths, I'm not sure how
to do this. Any help would be appreciated.

Thanks!


--
dailygluttony
------------------------------------------------------------------------
dailygluttony's Profile: http://www.excelforum.com/member.php...o&userid=32907
View this thread: http://www.excelforum.com/showthread...hreadid=527259


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default How do you truncate a text string?

Data text to columns, select delimited, click next, select - as other
delimiter click next select the right column and check do not import (skip)
under column data format. That way you can do a whole column in one fell
swoop


--

Regards,

Peo Sjoblom



"dailygluttony"
wrote in message
news:dailygluttony.25e7sy_1143571503.8005@excelfor um-nospam.com...

Hello,

I was wondering if there's a function that allows me to chop characters
of a fixed length off of text strings of varying lengths. For example,
if I have the following strings:

12345-ABC
123456-DEF

I want to be able to cut off the "-ABC" or the "-DEF" and be left with

12345
123456

Normally, I would simply use an =LEFT to capture the part I need, but
since the part before the dash is of varying lengths, I'm not sure how
to do this. Any help would be appreciated.

Thanks!


--
dailygluttony
------------------------------------------------------------------------
dailygluttony's Profile:
http://www.excelforum.com/member.php...o&userid=32907
View this thread: http://www.excelforum.com/showthread...hreadid=527259



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
Text string and sum michaelp Excel Worksheet Functions 4 November 14th 05 09:49 PM
Remove last character of text string Grant Excel Worksheet Functions 2 September 29th 05 05:17 PM
dynamic cell reference within a text string gvm Excel Worksheet Functions 4 July 25th 05 02:40 AM
Extracting from a text string AmyTaylor Excel Worksheet Functions 3 June 24th 05 01:34 PM
Formating a text string? METCO1 Excel Discussion (Misc queries) 2 November 30th 04 06:31 PM


All times are GMT +1. The time now is 07:20 AM.

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

About Us

"It's about Microsoft Excel"