Naming Format Formula

Bluez13

New Member
Joined
Mar 16, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am trying to perfect a formula so that I can take the first name middle initial (when present) and last name and format a certain way.

John T. Doe or John Doe

So far I have this formula that works when there is a middle initial present, but will leave the "Space" and "." in when there is no middle initial.

=A2&" "&IF(ISBLANK(K2),"",K2&". ")&C2

The spreadsheet works so that all I have to do is paste into the first 4 cells and the rest will autofill based from those cells. I then save as a csv to bulk upload for accounts. The "displayname" is where the above formula is at. Order of the cells does not matter past "D"

Also to note that the reference cell K2 has a formula to take the full middle name (from B2) and just format it to 1 letter. =LEFT(B2,1)

Any help with this would be GREATLY appreciated.

excel help.png
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi & welcome to MrExcel.
How about
+Fluff 1.xlsm
ABCDEFG
1
2JohnTomDoeJohn T.Doe
3JaneDoeJane.Doe
Main
Cell Formulas
RangeFormula
G2:G3G2=TEXTJOIN(" ",,A2,LEFT(B2))&"."&C2
 
Upvote 0
Hi,

Change ISBLANK to ="" (since you have formula in K2)

Book3.xlsx
ABCDEFGHIJK
1
2JohnThomasDoeJohn T. DoeT
3JohnDoeJohn Doe 
Sheet1049
Cell Formulas
RangeFormula
E2:E3E2=A2&" "&IF(K2="","",K2&". ")&C2
K2:K3K2=LEFT(B2,1)
 
Upvote 0
Solution
Think I misunderstood what you wanted.
Another option
+Fluff 1.xlsm
ABCDEFG
1
2JohnTomDoeJohn T. Doe
3JaneDoeJane Doe
4
Main
Cell Formulas
RangeFormula
G2:G3G2=TEXTJOIN({" ",". "},,A2,LEFT(B2),C2)
 
Upvote 0
Also, if you want to get rid of K2, you can use the formula in my sample F2:

Book3.xlsx
ABCDEFGHIJK
1
2JohnThomasDoeJohn T. DoeJohn T. DoeT
3JohnDoeJohn DoeJohn Doe 
Sheet1049
Cell Formulas
RangeFormula
E2:E3E2=A2&" "&IF(K2="","",K2&". ")&C2
F2:F3F2=SUBSTITUTE(TRIM(A2&" "&LEFT(B2,1)&" "&C2)," ",". ",2)
K2:K3K2=LEFT(B2,1)
 
Upvote 0
Thank you so much!! The spreadsheet is finally finished!
Hi,

Change ISBLANK to ="" (since you have formula in K2)

Book3.xlsx
ABCDEFGHIJK
1
2JohnThomasDoeJohn T. DoeT
3JohnDoeJohn Doe 
Sheet1049
Cell Formulas
RangeFormula
E2:E3E2=A2&" "&IF(K2="","",K2&". ")&C2
K2:K3K2=LEFT(B2,1)
Thank you so much!! It is finally finished. Greatly appreciated!!
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,148
Members
453,021
Latest member
Justyna P

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