Transposing contents of a cell

  • Thread starter Thread starter Fran
  • Start date Start date
F

Fran

I have an Excel spreadsheet with a column containing general text data in
the format e.g:-

Roberts, M. Tracey

which I want in the format:-

Tracey Roberts

I've managed to separate into 2 cells using the comma as a delimiter but now
want to get rid of the middle inital and fullstop. Any ideas gratefully
received
 
Assuming that you now have:

M. Tracey

in C1, then you could use this in D1 to remove the first 3 characters
if there is a full-stop in there:

=IF(ISNUMBER(SEARCH(".",C1)),RIGHT(C1,LEN(C1)-3),C1)

Copy down as required.

Hope this helps.

Pete
 
This will work on the original cell, swapping the first and last name
positions and removing the middle initial. Name is in cell A2:

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

This will work on the original data even if there is NO middle initial (with
full stop) listed, so one formula will work for the whole column, regardless:

=IF(ISNUMBER(SEARCH(".",A2)),
RIGHT(A2,LEN(A2)-FIND(".",A2)-1)&" "&
LEFT(A2,FIND(",",A2)-1),
RIGHT(A2,LEN(A2)-FIND(", ",A2)-1)&" "&
LEFT(A2,FIND(", ",A2)-1))

Hope that helps.
 
If you would rather keep your two cells with last name showing, use this
formula to pull Last Name only from the original cell, in place of what you
used that got you the initial, too:

=RIGHT(A2,LEN(A2)-FIND(".",A2)-1)

If there are some names with no middle initial, use this version to get just
the last name out of the original cell:

=IF(ISNUMBER(SEARCH(".",A2)),LEFT(A2,FIND(",",A2)-1),LEFT(A2,FIND(", ",A2)-1))
 
Use Data/ Text to Column a second time on your second column, and this time
use space as the delimiter, and get it to skip the first of those two
columns.

You could have done both operations together, using comma and space as
separators, and skipping the middle column.
 
I haven't tried any of all your suggestions yet but I now have 2 cols. One
contains the surname only and the other the forename and middle initial. It
is the middle initial I am trying to get rid of. Format is as follow:-

Col 1 = Roberts
Col 2 = Tracey M.

It is the M. I am trying to delete
 
Thanks all, for your help. This has now been sorted by using the data ->
text to cols function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top