custom format

  • Thread starter Thread starter Dreamstar_1961
  • Start date Start date
D

Dreamstar_1961

How to format something like 744532451500 into 74-45-32-45-15-00

this so the "-" are added automaticlly


Thanks
 
:

How to format something like 744532ba1500 into 74-45-32-ba-15-00

this so the "-" are added automaticlly

Forgot that the text is required in the middle


Thanks
 
XL can change teh format on numbers but it can not reformat text as you have
indicated. To do that you will need to use a formual in an adjacent cell
something like this...

=LEFT(A1, 2) & "-" & MID(A1, 3, 2) & "-" & MID(A1, 5, 2) & "-" & MID(A1, 7,
2) & "-" & MID(A1, 9, 2) & "-" & MID(A1, 11, 2)
 
Assuming that all the strings have the same number of characters (i.e. 12), a
formula like the one below will work.

=LEFT(A1,2)&"-"&MID(A1,3,2)&"-"&MID(A1,5,2)&"-"&MID(A1,7,2)&"-"&MID(A1,9,2)&"-"&RIGHT(A1,2)

HTH,

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top