View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Pranav Vaidya Pranav Vaidya is offline
external usenet poster
 
Posts: 180
Default How do I add dashes to a string?

this should help

=TEXT(MID(J5,1,LEN(J5)-1),"000-000-000")&RIGHT(J5,1)

--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"57chevy" wrote:

I have a column of thext in Excel that is

111222333
or
111222333L

And want to convert it so that it reads

111-222-333
or
111-222-333L

I have applied "=TEXT(A1, "000-000-000")" and have the format
"111-222-333" but when the original string has an "L" on the end, it's not
included. How can I reformat and preserve the L when it is in the original
string?