ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   custom format (https://www.excelbanter.com/excel-discussion-misc-queries/229356-custom-format.html)

Dreamstar_1961

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

this so the "-" are added automaticlly


Thanks

Dreamstar_1961

custom format
 


"Dreamstar_1961" wrote:

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

Jim Thomlinson

custom format
 
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)
--
HTH...

Jim Thomlinson


"Dreamstar_1961" wrote:



"Dreamstar_1961" wrote:

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


Eric G

custom format
 
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

"Dreamstar_1961" wrote:


"Dreamstar_1961" wrote:

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



All times are GMT +1. The time now is 02:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com