How to change a full name in cell to only last name first intial

kimsa

New Member
Joined
Feb 26, 2016
Messages
15
I have a full name in a cell and want to convert it to last name first initial only in another column

Have:
Smith, Mary

Want:
Smith, M

some cells have:
Smith, Mary / Jones, Sam

Want:

Smith, M; Jones, S
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
If you can use vba, copy to standard code module.

Code:
Sub t()
Dim c As Range, spl As Variant
With ActiveSheet
    For Each c In .Range("A2", .Cells(Rows.Count, 1).End(xlUp))
        If InStr(c, "/") Then
            spl = Split(c.Value, "/")
            c.Value = Left(spl(0), InStr(spl(0), ",") - 1) & ", " & Mid(spl(0), InStr(spl(0), ",") + 2, 1) _
            & "; " & Left(spl(1), InStr(spl(1), ",") - 1) & ", " & Mid(spl(1), InStr(spl(1), ",") + 2, 1)
        Else
            c = Left(c.Value, InStr(c.Value, ",") - 1) & ", " & Mid(c.Value, InStr(c.Value, ",") + 2, 1)
        End If
    Next
End With
End Sub
 
Upvote 0
Does this work?

=IF(IFERROR(SEARCH("/",A3),0)>0,LEFT(A3,SEARCH(",",A3)+2)&"; "&MID(A3,SEARCH("/",A3)+2,SEARCH(",",A3,SEARCH("/",A3))+2-(SEARCH("/",A3)+1)),LEFT(A3,SEARCH(",",A3)+2))
 
Upvote 0
Oh, I forgot. If you want to replace the original, you'll need to copy and paste as values
 
Upvote 0
Hi,

Another formula solution:


Book1
AB
1Smith, MarySmith, M
2Smith, Mary / Jones, SamSmith, M ; Jones, S
Sheet566
Cell Formulas
RangeFormula
B1=SUBSTITUTE(LEFT(A1,FIND(",",A1)+2)&IFERROR(LEFT(MID(A1,FIND("/",A1),99),FIND(",",A1,FIND("/",A1))-FIND("/",A1)+3),""),"/"," ;")
 
Upvote 0
Hi,

Another formula solution:

AB
1Smith, MarySmith, M
2Smith, Mary / Jones, SamSmith, M ; Jones, S

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet566

Worksheet Formulas
CellFormula
B1=SUBSTITUTE(LEFT(A1,FIND(",",A1)+2)&IFERROR(LEFT(MID(A1,FIND("/",A1),99),FIND(",",A1,FIND("/",A1))-FIND("/",A1)+3),""),"/"," ;")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
yes this worked great, if I have three names how would I adapt this formula
 
Upvote 0
Yes this worked. I need to know how to use this if three authors are involved

Smith, Mary / Smith, Susy / Smith, Ann

I also forgot to ask how would I invert the author names like below:

Have: Smith, Mary Need: Mary Smith
 
Upvote 0

Forum statistics

Threads
1,214,518
Messages
6,119,996
Members
448,935
Latest member
ijat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top