Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Red Lamps
 
Posts: n/a
Default re-arrange Data from "Jane Doe" to "Doe, Jane"

Is there a formula that manipulates data from "Jane Doe" to "Doe, Jane"?
  #2   Report Post  
Sloth
 
Posts: n/a
Default

you can use

=REPLACE(A1,1,FIND(" ",A1),"")&", "&LEFT(A1,FIND(" ",A1)-1)

only if each cell contains exactly two names seperated by a space. An
explanation may be in order as to what this formula does. FIND returns a
number from the beginning to the " " (using Jane Doe you get 5). REPLACE
replaces chars 1-FIND with nothing (outputing only the last name). The & is
how you add strings together (I inserted ", " to get the output you wanted).
LEFT returns the text from 1-FIND (using Jane Doe you get Jane). If you
don't use -1 in the LEFT function you would get a space at the end ("Doe,
Jane " as apposed to "Doe, Jane").

"Red Lamps" wrote:

Is there a formula that manipulates data from "Jane Doe" to "Doe, Jane"?

  #3   Report Post  
Sloth
 
Posts: n/a
Default

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

also works. LEN is the length of the string, so instead of subbing "" you
just pull the right name off the orginial string. In "Jane Doe" LEN is 8 and
FIND is 5, so RIGHT takes the last 3 digits (Doe).

"Sloth" wrote:

you can use

=REPLACE(A1,1,FIND(" ",A1),"")&", "&LEFT(A1,FIND(" ",A1)-1)

only if each cell contains exactly two names seperated by a space. An
explanation may be in order as to what this formula does. FIND returns a
number from the beginning to the " " (using Jane Doe you get 5). REPLACE
replaces chars 1-FIND with nothing (outputing only the last name). The & is
how you add strings together (I inserted ", " to get the output you wanted).
LEFT returns the text from 1-FIND (using Jane Doe you get Jane). If you
don't use -1 in the LEFT function you would get a space at the end ("Doe,
Jane " as apposed to "Doe, Jane").

"Red Lamps" wrote:

Is there a formula that manipulates data from "Jane Doe" to "Doe, Jane"?

  #4   Report Post  
Red Lamps
 
Posts: n/a
Default

You have no idea how much I appreciate you! What a time saver!

Thank you so much!

"Sloth" wrote:

you can use

=REPLACE(A1,1,FIND(" ",A1),"")&", "&LEFT(A1,FIND(" ",A1)-1)

only if each cell contains exactly two names seperated by a space. An
explanation may be in order as to what this formula does. FIND returns a
number from the beginning to the " " (using Jane Doe you get 5). REPLACE
replaces chars 1-FIND with nothing (outputing only the last name). The & is
how you add strings together (I inserted ", " to get the output you wanted).
LEFT returns the text from 1-FIND (using Jane Doe you get Jane). If you
don't use -1 in the LEFT function you would get a space at the end ("Doe,
Jane " as apposed to "Doe, Jane").

"Red Lamps" wrote:

Is there a formula that manipulates data from "Jane Doe" to "Doe, Jane"?

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
How do I import formmail data to a custom excel template? cxlough41 Excel Worksheet Functions 1 July 1st 05 12:59 AM
Data Source Name Not Found Justin Tyme Excel Worksheet Functions 0 June 16th 05 11:45 PM
Macro to search for and display data in another worksheet Mark H Excel Worksheet Functions 0 June 14th 05 12:40 PM
Running Data Table using an input that triggers DDE linked data [email protected] Excel Discussion (Misc queries) 1 December 16th 04 11:56 AM
Data Table - does it work with DDE links and Stock Tickers? Post Tenebras Lux Excel Worksheet Functions 0 December 1st 04 05:17 PM


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

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"