View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default splitting data from 1 column into multilple?

"Dan B" wrote...
I have 2 columns with data I need to split up. One column contains first
and last names. I need that into 2 columns, first in one, last in another.


Are all first and last names each single words? No middle names? No multiple
word last names? If so, you'd be better off inserting an empty column
immediately to the right of this column, selecting this column, using the
menu command Data Text to Columns, using its Delimited option, and using
Space as the field delimiter to split the column into first and last names.
If there are some middle names and some multiple word last names, it's more
difficult (e.g., handling both Jaan Van Burg and Nguyen Van Diep correctly
with one formula).

The other column of data has City ST Zip. There are no commas or periods.
I need that split into 3 columns.


If state is always a 2-character abreviation and zip code is always 5
digits,

City: =LEFT(TRIM(x),LEN(x)-9)
State: =LEFT(RIGHT(TRIM(x),8),2)
Zip: =RIGHT(TRIM(x),5)

If you have no multiple word cities, e.g., New York or Los Angeles, then you
could use Data Text to Columns for this. If you have a mixture of multiple
word city names and state names along with state abbreviations, then it gets
more difficult.