Turning Names to Abbreviations

Hoop71

New Member
Joined
Apr 24, 2010
Messages
4
I am looking for a way to turn a cell with a name eg.

John Adams Smith

into:
J. A. Smith

The trick is that it still needs to function if there are only 2 names eg.

John Smith

Thanks for the help in advance... I got lost in the stings of formulas on this one.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Welcome to the board!

Could probably tidy this up a little, I was getting lost in there somewhere too.

Try

=IF(LEN(B2)-LEN(SUBSTITUTE(B2," ",""))=0,LEFT(B2,1),IF(LEN(B2)-LEN(SUBSTITUTE(B2," ",""))=1,LEFT(B2,1)&". "&RIGHT(B2,LEN(B2)-FIND(" ",B2,1)),LEFT(B2,1)&"."&MID(B2,FIND(" ",B2)+1,1)&"."&RIGHT(B2,LEN(B2)-FIND(" ",B2,FIND(" ",B2)+1)+1)))

Think it does what you need.
 
Upvote 0
You looking for a formula in B1 that will take the value in A1 to display the conversion? Or a macro that will insert the new values into the original cells?

For a formula solution:

Excel Workbook
AB
1John Adam SmithJ. A. Smith
2John SmithJ. Smith
3Jane DoeJ. Doe
4J. Wilkes BoothJ. W. Booth
5John W BoothJ. W. Booth
Sheet1
 
Upvote 0
How about for this variation?

Smith, Allen -> Smith, A.
Smith, Allen William -> Smith, A.W.

Again needs to work for 2 and 3 word names...
 
Upvote 0
All in the same data set? Sounds very chaotic....

Excel Workbook
AB
1John Adam SmithJ. A. Smith
2John SmithJ. Smith
3Jane DoeJ. Doe
4J. Wilkes BoothJ. W. Booth
5John W BoothJ. W. Booth
6Smith, AllenSmith, A.
7Smith, Allen WilliamSmith, A.W.
Sheet3
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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