Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Melissa
 
Posts: n/a
Default RIGHT & MID & LEFT

I have a spreadsheet with all names converted to Last Name, First Name.
Some, not all, of the names have a middle name as well. I have searched
postings and Microsoft help and cannot figure out how to return "Smith, John
Michael" if I have the name "John Michael Smith". Thank you in advance for
any help.
  #2   Report Post  
Gary's Student
 
Posts: n/a
Default

I am assuming that you are starting with names like:

John Michael Smith
Victor Laszo

First use Data Text to Columns to split the field into three or two
separate cells.

Say the name are in column A, and the first name is in column B, column C
will either contain the middle or last name. Column D will contain the last
name if there is a middle name.

Use the IF function to see if the cell in D is empty.

if D is empty then use =C1 & ", " & B1
If D is not empty then use =D1 & ", " & B1 & " " & C1
--
Gary's Student


"Melissa" wrote:

I have a spreadsheet with all names converted to Last Name, First Name.
Some, not all, of the names have a middle name as well. I have searched
postings and Microsoft help and cannot figure out how to return "Smith, John
Michael" if I have the name "John Michael Smith". Thank you in advance for
any help.

  #3   Report Post  
Melissa
 
Posts: n/a
Default

I currently have the following formula for those names without a middle
name/initial. Is there not a way I can just add "MID" to it?

=RIGHT(A19,LEN(A19)-FIND(" ",A19))&", "&LEFT(A19,FIND(" ",A19)-1)

"Gary's Student" wrote:

I am assuming that you are starting with names like:

John Michael Smith
Victor Laszo

First use Data Text to Columns to split the field into three or two
separate cells.

Say the name are in column A, and the first name is in column B, column C
will either contain the middle or last name. Column D will contain the last
name if there is a middle name.

Use the IF function to see if the cell in D is empty.

if D is empty then use =C1 & ", " & B1
If D is not empty then use =D1 & ", " & B1 & " " & C1
--
Gary's Student


"Melissa" wrote:

I have a spreadsheet with all names converted to Last Name, First Name.
Some, not all, of the names have a middle name as well. I have searched
postings and Microsoft help and cannot figure out how to return "Smith, John
Michael" if I have the name "John Michael Smith". Thank you in advance for
any help.

  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

=IF(LEN(A19)-LEN(SUBSTITUTE(A19," ",""))1,RIGHT(A19,LEN(A19)-FIND("
",A19,FIND(" ",A19)+1))&", "&LEFT(A19,FIND(" ",A19,FIND("
",A19)+1)-1),RIGHT(A19,LEN(A19)-FIND(" ",A19))&", "&LEFT(A19,FIND("
",A19)-1))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Melissa" wrote in message
...
I currently have the following formula for those names without a middle
name/initial. Is there not a way I can just add "MID" to it?

=RIGHT(A19,LEN(A19)-FIND(" ",A19))&", "&LEFT(A19,FIND(" ",A19)-1)

"Gary's Student" wrote:

I am assuming that you are starting with names like:

John Michael Smith
Victor Laszo

First use Data Text to Columns to split the field into three or two
separate cells.

Say the name are in column A, and the first name is in column B, column

C
will either contain the middle or last name. Column D will contain the

last
name if there is a middle name.

Use the IF function to see if the cell in D is empty.

if D is empty then use =C1 & ", " & B1
If D is not empty then use =D1 & ", " & B1 & " " & C1
--
Gary's Student


"Melissa" wrote:

I have a spreadsheet with all names converted to Last Name, First

Name.
Some, not all, of the names have a middle name as well. I have

searched
postings and Microsoft help and cannot figure out how to return

"Smith, John
Michael" if I have the name "John Michael Smith". Thank you in

advance for
any help.



  #5   Report Post  
Melissa
 
Posts: n/a
Default

Thank you.

When I tried this formula, and changed the "A19" to the correct cell, I
received a #VALUE error. I'm not familiar with many of the formulas in
excel. Any suggestions?

"Bob Phillips" wrote:

=IF(LEN(A19)-LEN(SUBSTITUTE(A19," ",""))1,RIGHT(A19,LEN(A19)-FIND("
",A19,FIND(" ",A19)+1))&", "&LEFT(A19,FIND(" ",A19,FIND("
",A19)+1)-1),RIGHT(A19,LEN(A19)-FIND(" ",A19))&", "&LEFT(A19,FIND("
",A19)-1))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Melissa" wrote in message
...
I currently have the following formula for those names without a middle
name/initial. Is there not a way I can just add "MID" to it?

=RIGHT(A19,LEN(A19)-FIND(" ",A19))&", "&LEFT(A19,FIND(" ",A19)-1)

"Gary's Student" wrote:

I am assuming that you are starting with names like:

John Michael Smith
Victor Laszo

First use Data Text to Columns to split the field into three or two
separate cells.

Say the name are in column A, and the first name is in column B, column

C
will either contain the middle or last name. Column D will contain the

last
name if there is a middle name.

Use the IF function to see if the cell in D is empty.

if D is empty then use =C1 & ", " & B1
If D is not empty then use =D1 & ", " & B1 & " " & C1
--
Gary's Student


"Melissa" wrote:

I have a spreadsheet with all names converted to Last Name, First

Name.
Some, not all, of the names have a middle name as well. I have

searched
postings and Microsoft help and cannot figure out how to return

"Smith, John
Michael" if I have the name "John Michael Smith". Thank you in

advance for
any help.






  #6   Report Post  
Bob Phillips
 
Posts: n/a
Default

You need to be careful because it is so long. Copy it and paste it into the
formula bar, not the cell, and amend it there.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Melissa" wrote in message
...
Thank you.

When I tried this formula, and changed the "A19" to the correct cell, I
received a #VALUE error. I'm not familiar with many of the formulas in
excel. Any suggestions?

"Bob Phillips" wrote:

=IF(LEN(A19)-LEN(SUBSTITUTE(A19," ",""))1,RIGHT(A19,LEN(A19)-FIND("
",A19,FIND(" ",A19)+1))&", "&LEFT(A19,FIND(" ",A19,FIND("
",A19)+1)-1),RIGHT(A19,LEN(A19)-FIND(" ",A19))&", "&LEFT(A19,FIND("
",A19)-1))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Melissa" wrote in message
...
I currently have the following formula for those names without a

middle
name/initial. Is there not a way I can just add "MID" to it?

=RIGHT(A19,LEN(A19)-FIND(" ",A19))&", "&LEFT(A19,FIND(" ",A19)-1)

"Gary's Student" wrote:

I am assuming that you are starting with names like:

John Michael Smith
Victor Laszo

First use Data Text to Columns to split the field into three or

two
separate cells.

Say the name are in column A, and the first name is in column B,

column
C
will either contain the middle or last name. Column D will contain

the
last
name if there is a middle name.

Use the IF function to see if the cell in D is empty.

if D is empty then use =C1 & ", " & B1
If D is not empty then use =D1 & ", " & B1 & " " & C1
--
Gary's Student


"Melissa" wrote:

I have a spreadsheet with all names converted to Last Name, First

Name.
Some, not all, of the names have a middle name as well. I have

searched
postings and Microsoft help and cannot figure out how to return

"Smith, John
Michael" if I have the name "John Michael Smith". Thank you in

advance for
any help.






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
Returning left part of cell before a character Alan Excel Discussion (Misc queries) 6 April 4th 23 02:26 PM
Cell Borders and "Columns to Repeat at Left" DeLeo Excel Discussion (Misc queries) 0 July 28th 05 03:41 PM
excel organizational chart subordinate goes left not down Bhamgirl Charts and Charting in Excel 0 May 11th 05 12:45 AM
Scrollbar on Chart Jumps to Left when Chart is Clicked Bob Charts and Charting in Excel 5 May 1st 05 02:06 AM
The left function does not work when displaying times, how is thi. Nambo27 Excel Worksheet Functions 3 February 25th 05 06:46 PM


All times are GMT +1. The time now is 07:53 AM.

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"