How to place periods between initials

sue_ellen_27

New Member
Joined
Oct 6, 2011
Messages
3
Hi,

How can I place periods between initials if I have for example ABC in cell A1 and want to change it to A.B.C.?

Thanks.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Excel Workbook
ABC
1ABCA.B.C<< If Only 3 Letters in A1
Sheet1
Excel 2007
Cell Formulas
RangeFormula
B1=LEFT(A1) & "." & MID(A1,2,1) & "." & RIGHT(A1)
 
Upvote 0
Thanks four your reply! It works!

The only thing is that the amount of initials varies. It can be one, two, three or for. How can I place this into the formula?
 
Upvote 0
or...

=IF(LEN(A1)>0,IF(LEN(A1)>1,IF(LEN(A1)>2,LEFT(A1,1) & "." & MID(A1,2,1) & "." & RIGHT(A1,1) & ".",LEFT(A1,1) & "." & RIGHT(A1,1) & "."),LEFT(A1,1) & "."))

if it can be 1, 2, or 3 characters in length.
 
Upvote 0
Try this version for any number up to 4

=SUBSTITUTE(TRIM(MID(A1,1,1)&" "&MID(A1,2,1)&" "&MID(A1,3,1)&" "&MID(A1,4,1))," ",".")
 
Upvote 0
If, in the future, you could possibly be faced with longer text to insert dots into, then you might want to consider this UDF (user defined function)... it adapts automatically to whatever the length of the text is.

Code:
Function InsertDots(ByVal S As String) As String
  If Len(S) Then InsertDots = Left(Replace(StrConv(S, vbUnicode), Chr(0), "."), 2 * Len(S) - 1)
End Function
If you have never worked with UDFs before, they are quite easy to use. You install the code in the same place that macros get install to... a standard module. If this is new to you... press ALT+F11 from any worksheet to go into the VB editor, then click Insert/Module once there and copy/paste the code into the code window that opened up). Once you have installed the code, go back to the worksheet and use the function just like you would any other Excel function. For this case, you would simply put this into your cell...

=InsertDots(A1)

This formula can be copied down or across as needed.
 
Last edited:
Upvote 0
An expansion of fcorn's formula for four characters is this...

=IF(LEN(A1)>0,IF(LEN(A1)>1,IF(LEN(A1)>2,IF(LEN(A1)>3,LEFT(A1,1) & "." & MID(A1,2,1) & "." & MID(A1,3,1) & "." & RIGHT(A1,1) & ".",LEFT(A1,1) & "." & MID(A1,2,1) & "." & RIGHT(A1,1) & "."),LEFT(A1,1) & "." & RIGHT(A1,1) & "."),LEFT(A1,1) & "."))
 
Upvote 0

Forum statistics

Threads
1,226,093
Messages
6,188,869
Members
453,505
Latest member
BigVince

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