serting dashes

  • Thread starter Thread starter shannonk
  • Start date Start date
S

shannonk

Hi there

I have a column of numbers and i want to insert dashes into them. Fo
example i want the number 33114 to become 3-3-1-14

All the number are 5 digits long and they all need to be in the sam
format of x-x-x-xx

Any ideas?
 
Hi Shannon,

Click on the cell(s) you want to convert to this format. On
the tool bar click Format>Cells. Click the Number tab in
the Format Cells dialog box. In the "Category:" field click
Custom. In the single line field just below the word
"Type:" you can highlight and delete the existing format.
Don't worry, this won't delete it from your system.
Now enter "#-#-#-##" in this field without the quote marks
and click OK. This creates the format and you will see it
in the "Type" box as an option to select. Your cell should
now have the format applied to it.

~~charles osborne
 
The previous two answers are the easiest but if you want or need actual
text:

assume 12345 is in A1 and the below formula is in A2
=CONCATENATE(MID(A1,1,1),"-",MID(A1,2,1),"-",MID(A1,3,1),"-",RIGHT(A1,2))
the result will be 1-2-3-45 in A2
copy special the result as a value in another cell (say A3) and you will
have the text you want.
you can then delete the formula
 
Back
Top