ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how to format cells having text and numeric (https://www.excelbanter.com/excel-worksheet-functions/118831-how-format-cells-having-text-numeric.html)

PSL

how to format cells having text and numeric
 
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.

macropod

how to format cells having text and numeric
 
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)

--
macropod
[MVP - Microsoft Word]


"PSL" wrote in message
...
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.




Dave Peterson

how to format cells having text and numeric
 
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.

PSL wrote:

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.


--

Dave Peterson


All times are GMT +1. The time now is 12:08 AM.

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