#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 82
Default Text to Columns

Hi.

I have a column where I have names and surnames. I want to put name in one
column and surname in anoter column. In order to do this, I use Text to
Columns, but I have the following issue: if the cell contains for example
Juan Pérez, it works ok, but when the cell contains Juan De los Santos, it
assumes there are three surnames, and then put me one word in each column.

This is the result, with the example mentioned:
A B C D
Juan Pérez
Juan De los Santos

How can I indicate that I want De los Santos, all in one cell?

Thanks in advance

Regards,
Emece.-

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 457
Default Text to Columns

Instead of using Text to columns, I'd do this via formulas:
First Name:
=LEFT(A2,FIND(" ",A2)-1)

Surname:
=MID(A2,FIND(" ",A2)+1,999)

--
Best Regards,

Luke M
"Emece" wrote in message
...
Hi.

I have a column where I have names and surnames. I want to put name in one
column and surname in anoter column. In order to do this, I use Text to
Columns, but I have the following issue: if the cell contains for example
Juan Prez, it works ok, but when the cell contains Juan De los Santos, it
assumes there are three surnames, and then put me one word in each column.

This is the result, with the example mentioned:
A B C D
Juan Prez
Juan De los Santos

How can I indicate that I want De los Santos, all in one cell?

Thanks in advance

Regards,
Emece.-



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Text to Columns

With: Juan De los Santos in cell A1 -
* In cell C1 Type: =TRIM(RIGHT(A1,FIND(" ",A1)+1))
* In cell B1 type: =SUBSTITUTE(A1,C1,"")
Micky


"Emece" wrote:

Hi.

I have a column where I have names and surnames. I want to put name in one
column and surname in anoter column. In order to do this, I use Text to
Columns, but I have the following issue: if the cell contains for example
Juan Pérez, it works ok, but when the cell contains Juan De los Santos, it
assumes there are three surnames, and then put me one word in each column.

This is the result, with the example mentioned:
A B C D
Juan Pérez
Juan De los Santos

How can I indicate that I want De los Santos, all in one cell?

Thanks in advance

Regards,
Emece.-

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Text to Columns

You may try also the Text to Columns feature.
In step 2 of 3 drag out(!) the marked vertical divider and press "Finish".
http://img69.imageshack.us/img69/4248/nonamef.png
Micky


"Emece" wrote:

Hi.

I have a column where I have names and surnames. I want to put name in one
column and surname in anoter column. In order to do this, I use Text to
Columns, but I have the following issue: if the cell contains for example
Juan Pérez, it works ok, but when the cell contains Juan De los Santos, it
assumes there are three surnames, and then put me one word in each column.

This is the result, with the example mentioned:
A B C D
Juan Pérez
Juan De los Santos

How can I indicate that I want De los Santos, all in one cell?

Thanks in advance

Regards,
Emece.-

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Text to Columns

Your method works only with fixed width Micky.

Which is OK if all first names are same length.


Gord Dibben MS Excel MVP

On Tue, 1 Jun 2010 11:58:01 -0700, ????? (????) ?????
<micky-a[atsymbol]tapuz[dot]co[dot]il wrote:

You may try also the Text to Columns feature.
In step 2 of 3 drag out(!) the marked vertical divider and press "Finish".
http://img69.imageshack.us/img69/4248/nonamef.png
Micky


"Emece" wrote:

Hi.

I have a column where I have names and surnames. I want to put name in one
column and surname in anoter column. In order to do this, I use Text to
Columns, but I have the following issue: if the cell contains for example
Juan Prez, it works ok, but when the cell contains Juan De los Santos, it
assumes there are three surnames, and then put me one word in each column.

This is the result, with the example mentioned:
A B C D
Juan Prez
Juan De los Santos

How can I indicate that I want De los Santos, all in one cell?

Thanks in advance

Regards,
Emece.-




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 82
Default Text to Columns

Thanks to all for your helpful replies.

I need a little extra help.

I noticed that there are some cases in which I have two names also.

So I have the following options: two names and one surname, one name and two
surnames, and two names and two surnames.

Examples:
John Steven Jackson
John Jackson
John Jackson Ville

Which formulas are suitable for all options? I want to obtain names in one
cell, surnames in other cell.

Thanks again.

Regards,
Emece.-


"Gord Dibben" wrote:

Your method works only with fixed width Micky.

Which is OK if all first names are same length.


Gord Dibben MS Excel MVP

On Tue, 1 Jun 2010 11:58:01 -0700, ????? (????) ?????
<micky-a[atsymbol]tapuz[dot]co[dot]il wrote:

You may try also the Text to Columns feature.
In step 2 of 3 drag out(!) the marked vertical divider and press "Finish".
http://img69.imageshack.us/img69/4248/nonamef.png
Micky


"Emece" wrote:

Hi.

I have a column where I have names and surnames. I want to put name in one
column and surname in anoter column. In order to do this, I use Text to
Columns, but I have the following issue: if the cell contains for example
Juan Pérez, it works ok, but when the cell contains Juan De los Santos, it
assumes there are three surnames, and then put me one word in each column.

This is the result, with the example mentioned:
A B C D
Juan Pérez
Juan De los Santos

How can I indicate that I want De los Santos, all in one cell?

Thanks in advance

Regards,
Emece.-


.

  #7   Report Post  
Senior Member
 
Location: Philippines
Posts: 161
Talking

Quote:
Originally Posted by Emece View Post
Thanks to all for your helpful replies.

I need a little extra help.

I noticed that there are some cases in which I have two names also.

So I have the following options: two names and one surname, one name and two
surnames, and two names and two surnames.

Examples:
John Steven Jackson
John Jackson
John Jackson Ville

Which formulas are suitable for all options? I want to obtain names in one
cell, surnames in other cell.

Thanks again.

Regards,
Emece.-


"Gord Dibben" wrote:

Your method works only with fixed width Micky.

Which is OK if all first names are same length.


Gord Dibben MS Excel MVP

On Tue, 1 Jun 2010 11:58:01 -0700, ????? (????) ?????
<micky-a[atsymbol]tapuz[dot]co[dot]il wrote:

You may try also the Text to Columns feature.
In step 2 of 3 drag out(!) the marked vertical divider and press "Finish".
http://img69.imageshack.us/img69/4248/nonamef.png
Micky


"Emece" wrote:

Hi.

I have a column where I have names and surnames. I want to put name in one
column and surname in anoter column. In order to do this, I use Text to
Columns, but I have the following issue: if the cell contains for example
Juan Pérez, it works ok, but when the cell contains Juan De los Santos, it
assumes there are three surnames, and then put me one word in each column.

This is the result, with the example mentioned:
A B C D
Juan Pérez
Juan De los Santos

How can I indicate that I want De los Santos, all in one cell?

Thanks in advance

Regards,
Emece.-


.
Here's how I did it:

Still do the Text-to-Columns with SPACES as your Delimiter. Now, you may have 3 or 4 columns per name.

Let's say:

Column A has the full Name
Column C has the 1st split of the name
Column D has the 2nd split of the name
Column E has the 3rd split of the name
Column F has the 4th split of the name

For the First Name column (Column H), your formula should be:
=IF(F1="",D1,CONCATENATE(D1," ",E1))

For the Last Name column (Column I), you formula should be:
=IF(AND(G1="",F1=""),E1,IF(AND(G1="",F1<""),F1,CO NCATENATE(F1," ",G1)))

The following scenario for the Last Name column output may be incorrect:
1. Person has 3 first names
2. Person has a JR., SR., II, IV, etc
3. Name has a middle initial in the list.

Last edited by wickedchew : August 1st 10 at 06:26 PM
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
Data, Text to Columns, has commas in the text, plus as a delimeter Tonso Excel Discussion (Misc queries) 2 May 20th 10 02:21 PM
Combining Text from 2 Columns into 1 then Deleting the 2 Columns sleepindogg Excel Worksheet Functions 5 September 19th 08 12:36 AM
help with sorting text in columns to match other columns rkat Excel Discussion (Misc queries) 1 August 11th 06 03:42 AM
merge text from 2 columns into 1 then delete the old 2 columns sleepindogg Excel Worksheet Functions 4 March 30th 06 07:25 PM
Linking text columns with text and data columns Edd Excel Worksheet Functions 0 March 17th 05 04:23 PM


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