#1   Report Post  
anar_baku
 
Posts: n/a
Default STRING functions


I have the following problem, please help me out:

I have text strings in the following format:

xxxxxxxxx-yyyyyyyyyyyy
xxx-yyyyyyyyyyy

I want to extract the 1st parts from the above strings (i.e. xxxxxx
part). Using the simple LEFT function is out of question as the string
length varies. The only thing that is consistent among these strings is
that the 1st Parts and 2nd Parts are seperated by a "-". Is there a way
to tell excel to extract everything before the "-"? I imagine FIND
fucntion will be used to find the "-" in the string, but what then ????
:(


--
anar_baku
------------------------------------------------------------------------
anar_baku's Profile: http://www.excelforum.com/member.php...o&userid=18259
View this thread: http://www.excelforum.com/showthread...hreadid=483147

  #2   Report Post  
Max
 
Posts: n/a
Default STRING functions

Assume strings in A1 down
Put in say, B1: =LEFT(A1,SEARCH("-",A1)-1)
Copy B1 down
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"anar_baku" wrote in
message ...

I have the following problem, please help me out:

I have text strings in the following format:

xxxxxxxxx-yyyyyyyyyyyy
xxx-yyyyyyyyyyy

I want to extract the 1st parts from the above strings (i.e. xxxxxx
part). Using the simple LEFT function is out of question as the string
length varies. The only thing that is consistent among these strings is
that the 1st Parts and 2nd Parts are seperated by a "-". Is there a way
to tell excel to extract everything before the "-"? I imagine FIND
fucntion will be used to find the "-" in the string, but what then ????
:(


--
anar_baku
------------------------------------------------------------------------
anar_baku's Profile:

http://www.excelforum.com/member.php...o&userid=18259
View this thread: http://www.excelforum.com/showthread...hreadid=483147



  #3   Report Post  
RagDyeR
 
Posts: n/a
Default STRING functions

Hey Max,

You could've used Find() and made the OP feel good, in that (s)he at least
picked the right function.<bg
--

Regards,

RD
----------------------------------------------------------------------------
-------------------
Please keep all correspondence within the Group, so all may benefit !
----------------------------------------------------------------------------
-------------------

"Max" wrote in message
...
Assume strings in A1 down
Put in say, B1: =LEFT(A1,SEARCH("-",A1)-1)
Copy B1 down
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"anar_baku" wrote in
message ...

I have the following problem, please help me out:

I have text strings in the following format:

xxxxxxxxx-yyyyyyyyyyyy
xxx-yyyyyyyyyyy

I want to extract the 1st parts from the above strings (i.e. xxxxxx
part). Using the simple LEFT function is out of question as the string
length varies. The only thing that is consistent among these strings is
that the 1st Parts and 2nd Parts are seperated by a "-". Is there a way
to tell excel to extract everything before the "-"? I imagine FIND
fucntion will be used to find the "-" in the string, but what then ????
:(


--
anar_baku
------------------------------------------------------------------------
anar_baku's Profile:

http://www.excelforum.com/member.php...o&userid=18259
View this thread: http://www.excelforum.com/showthread...hreadid=483147




  #4   Report Post  
anar_baku
 
Posts: n/a
Default STRING functions


Thanks guys, this worked!


--
anar_baku
------------------------------------------------------------------------
anar_baku's Profile: http://www.excelforum.com/member.php...o&userid=18259
View this thread: http://www.excelforum.com/showthread...hreadid=483147

  #5   Report Post  
Max
 
Posts: n/a
Default STRING functions

You're welcome !

As RD said <g, here we could have used FIND instead of SEARCH

FIND is case sensitive while SEARCH is not,
but it doesn't matter here since we're looking for the "-", not alphas
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"anar_baku" wrote
in message ...

Thanks guys, this worked!



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
String Extraction... iceberg27 Excel Worksheet Functions 2 October 15th 05 04:28 AM
Auto convert an alphanumeric string (CIS9638S) to numbers only? Gary L Brown Excel Worksheet Functions 1 September 7th 05 01:17 AM
Improvements for text finding functions yarp Excel Discussion (Misc queries) 2 August 8th 05 04:01 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
How do I use 3 cells to create the string for a lookup function? Bencomo Excel Worksheet Functions 1 May 15th 05 07:17 AM


All times are GMT +1. The time now is 05:38 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"