how to format cells having text and numeric

P

PSL

Hi,
Please help me formating cells.

Example:

DM17043X10 - this is the text having in a cell

I need to format the above text as:

DM-1704- -3X10

spaces given between 4- & -3
Please help me on this.

Thank You,
PSL.
 
M

macropod

Hi PSL,

You can't do this through formatting but, provided your data always have the
same format, you can use a formula like the one below to reformat the
strings:
=LEFT(A1,2)&"-"&MID(A1,3,4)&"- -"&RIGHT(A1,4)
 
D

Dave Peterson

You can't do this with a number format.

But you could use a helper cell and a formula:
=left(a1,2) & "-" & mid(a1,3,4) & "- -" & right(a1,4)

This may work ok if all the data is really 10 characters wide.
 
Top