#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Parsing

Is it possible to parse the data below (including brackets), so that it
appears as set out further down. The first in the list is in cell A2.

Solent 36
Group Captain 29
Before You Go 23
Purple Moon 37
Halla San 29
Strategic Mount 324
John Terry 16
Celtic Spirit 32
Misty Dancer 36
Mull Of Dubai 24
Dan Dare 29
High Treason 16
Instructor 84 (59J)
Masterofthecourt 11
.............................

Solent
Group Captain
Before You Go
Purple Moon
Halla San
Strategic Mount
John Terry
Celtic Spirit
Misty Dancer
Mull Of Dubai
Dan Dare
High Treason
Instructor
Masterofthecourt

=IF(ISERR(LEFT(A2,FIND(" ",A2)-1)),A2,LEFT(A2,FIND(" ",A2)-1))

The above will do it, but gets rid of everything except the first word.

Is it possible to capitalise the results?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Parsing

Try:

=UPPER(LEFT(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&" 0123456789"))-2))

"Saxman" wrote:

Is it possible to parse the data below (including brackets), so that it
appears as set out further down. The first in the list is in cell A2.

Solent 36
Group Captain 29
Before You Go 23
Purple Moon 37
Halla San 29
Strategic Mount 324
John Terry 16
Celtic Spirit 32
Misty Dancer 36
Mull Of Dubai 24
Dan Dare 29
High Treason 16
Instructor 84 (59J)
Masterofthecourt 11
.............................

Solent
Group Captain
Before You Go
Purple Moon
Halla San
Strategic Mount
John Terry
Celtic Spirit
Misty Dancer
Mull Of Dubai
Dan Dare
High Treason
Instructor
Masterofthecourt

=IF(ISERR(LEFT(A2,FIND(" ",A2)-1)),A2,LEFT(A2,FIND(" ",A2)-1))

The above will do it, but gets rid of everything except the first word.

Is it possible to capitalise the results?

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Parsing

While the original data didn't include any without trailing numbers (e.g.,
"Solent") or without a space between the trailing number and the text that
comes before it (e.g., "Solent36"), you can generalize your function to
handle the given data plus these variations by changing the subtraction of 2
to a subtraction of 1 and using the TRIM function...

=UPPER(TRIM(LEFT(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9} ,A2&"0123456789"))-1)))

Rick


"Toppers" wrote in message
...
Try:

=UPPER(LEFT(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&" 0123456789"))-2))

"Saxman" wrote:

Is it possible to parse the data below (including brackets), so that it
appears as set out further down. The first in the list is in cell A2.

Solent 36
Group Captain 29
Before You Go 23
Purple Moon 37
Halla San 29
Strategic Mount 324
John Terry 16
Celtic Spirit 32
Misty Dancer 36
Mull Of Dubai 24
Dan Dare 29
High Treason 16
Instructor 84 (59J)
Masterofthecourt 11
.............................

Solent
Group Captain
Before You Go
Purple Moon
Halla San
Strategic Mount
John Terry
Celtic Spirit
Misty Dancer
Mull Of Dubai
Dan Dare
High Treason
Instructor
Masterofthecourt

=IF(ISERR(LEFT(A2,FIND(" ",A2)-1)),A2,LEFT(A2,FIND(" ",A2)-1))

The above will do it, but gets rid of everything except the first word.

Is it possible to capitalise the results?

Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 111
Default Parsing

Rick Rothstein (MVP - VB) wrote:
While the original data didn't include any without trailing numbers
(e.g., "Solent") or without a space between the trailing number and the
text that comes before it (e.g., "Solent36"), you can generalize your
function to handle the given data plus these variations by changing the
subtraction of 2 to a subtraction of 1 and using the TRIM function...

=UPPER(TRIM(LEFT(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9} ,A2&"0123456789"))-1)))

Rick


This works beautifully.

Thanks to all.
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
Parsing in Excel? DavidMunday Excel Worksheet Functions 1 August 4th 10 04:34 AM
Instead of Parsing Krish Excel Discussion (Misc queries) 1 November 4th 06 08:32 PM
Parsing Problem Gloria Lewis Excel Discussion (Misc queries) 6 January 23rd 06 06:06 PM
Help With Parsing Data Saxman Excel Discussion (Misc queries) 5 December 27th 05 02:39 PM
Parsing Data Saxman Excel Discussion (Misc queries) 4 December 8th 05 08:31 AM


All times are GMT +1. The time now is 03:16 PM.

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

About Us

"It's about Microsoft Excel"