custom format

D

Dreamstar_1961

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

this so the "-" are added automaticlly


Thanks
 
D

Dreamstar_1961

:

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
 
J

Jim Thomlinson

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)
 
E

Eric G

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
 
Top