View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Spliting Numbers from a Text string

Are you trying to extract the numbers that appear after " PM " into separate
cells?

You could use
=TRIM(MID(A1,FIND(" PM ",A1)+4,LEN(A1)))
to extract everything to the right of " PM ".

so you would have
16.00 16.00 1.00 2.00 0.00 11.83 19.
all in one cell

Then copy this extracted string of numbers and click edit/paste
special/values to hardcode the string. Then click Data/Text To Columns and
use a space delimiter to separate each number into its own cell (ensure there
is no data in the columns to the right as they could get overwritten).


"wutzke" wrote:

In my worksheet I have a series of cells containing a text string. I
Would like split the text up into individual cells. The "05" is a
date. "PM" is a time code. Everything between "05" & "PM" is a
complete title.

All the rest after "PM" is seven numbers separrated by a space.

day location
05 BARHRJANS REGULAR1 PM 16.00 16.00 1.00 2.00 0.00 11.83 19.
05 BARHYTRFGHKNS REGULAR2 PM 1.00 1.00 10.00 20.00 0.00 121.83 129.
05 BARHHUNNY44S REGULAR3 PM 110.00 10.00 10.00 2.00 0.00 11.83 119.
05 BARHR887-GUNNS REGULAR4 PM 0.00 0.00 1.00 2.00 0.00 11.83 19.

The date code, "05" and time code "PM" never change in text length.
But the title length and the number vary in length.

=VALUE(MID(RIGHT(A1,LEN(A1)-SEARCH(" PM ",A1)-3),
1,SEARCH(".",RIGHT(A1,LEN(A1)-SEARCH(" PM ",A1)-3)))) will give me
the 1st value of 16 if I use the time code "PM" to search with and
then the decimal point "."

Is there a better way?