Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 683
Default Extracting a SubString

I have a set of data that has leading spaces before each substring, and i
want to extract one particular string that has somehow eluded me. I checked
out Michelle Valeriano's samples and that allowed me to figure out all but
one. So here is a couple of the data samples:

Cell A3: tall_3 = 0003.00 -21.00 0.00
Cell A4: tall_4 = 5240.00 26.54 1.50

If I wanted to extract just the "-21.00" from A3 or the "26.54" from A4, how
would I go about doing so using the SEARCH function?

TIA

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Extracting a SubString

Maybe:-

=TRIM(MID(TRIM(A1),17,7))

Mike

"Brian" wrote:

I have a set of data that has leading spaces before each substring, and i
want to extract one particular string that has somehow eluded me. I checked
out Michelle Valeriano's samples and that allowed me to figure out all but
one. So here is a couple of the data samples:

Cell A3: tall_3 = 0003.00 -21.00 0.00
Cell A4: tall_4 = 5240.00 26.54 1.50

If I wanted to extract just the "-21.00" from A3 or the "26.54" from A4, how
would I go about doing so using the SEARCH function?

TIA

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Extracting a SubString

On Tue, 26 Jun 2007 12:24:00 -0700, Brian
wrote:

I have a set of data that has leading spaces before each substring, and i
want to extract one particular string that has somehow eluded me. I checked
out Michelle Valeriano's samples and that allowed me to figure out all but
one. So here is a couple of the data samples:

Cell A3: tall_3 = 0003.00 -21.00 0.00
Cell A4: tall_4 = 5240.00 26.54 1.50

If I wanted to extract just the "-21.00" from A3 or the "26.54" from A4, how
would I go about doing so using the SEARCH function?

TIA


Assuming your format is as above, then the values to be extracted are between
the third and fourth spaces, you can use this:

=MID(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),3))+1,
FIND(" ",A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),3))+1)-
FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),3))-1)


--ron
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 683
Default Extracting a SubString

Thanks Ron - yours worked dynamically, whereas Mike's would be fine for data
that is the same number of characters everytime.

"Ron Rosenfeld" wrote:

=MID(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),3))+1,
FIND(" ",A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),3))+1)-
FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),3))-1)


--ron

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Extracting a SubString

On Wed, 27 Jun 2007 11:42:06 -0700, Brian
wrote:

Thanks Ron - yours worked dynamically, whereas Mike's would be fine for data
that is the same number of characters everytime.



Glad to help. Thanks for the feedback
--ron


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
Finding a Substring? Jakobshavn Isbrae Excel Worksheet Functions 4 February 22nd 07 03:26 PM
Substring Ldyflyr Excel Discussion (Misc queries) 0 February 15th 07 03:16 PM
Substring Petya Excel Discussion (Misc queries) 0 February 15th 07 02:53 PM
Sumproduct based on substring? altopalo Excel Worksheet Functions 4 July 16th 05 04:53 PM
Vlookup using a substring for evaluation? frosterrj Excel Worksheet Functions 6 December 22nd 04 01:23 AM


All times are GMT +1. The time now is 07:24 PM.

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"