ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to add "-" into 10 digit numbers (https://www.excelbanter.com/excel-worksheet-functions/185375-how-add-into-10-digit-numbers.html)

Dr. S

How to add "-" into 10 digit numbers
 
Having a column with 10 digit alphanumeric data (ie H1187600) I need to add
dashes after the 2nd and the 6th digit to look like H1-1876-00.
Shouldn't be difficult?

Pete_UK

How to add "-" into 10 digit numbers
 
Try this:

=LEFT(A1,2)&"-"&MID(A1,3,4)&"-"&RIGHT(A1,2)

I assume you mean you are starting with 8 digit data and want it to
become 10 digit (characters).

Hope this helps.

Pete

On Apr 28, 1:36*pm, Dr. S <Dr. wrote:
Having a column with 10 digit alphanumeric data (ie H1187600) I need to add
dashes after the 2nd and the 6th digit to look like H1-1876-00.
Shouldn't be difficult?



Ron Rosenfeld

How to add "-" into 10 digit numbers
 
On Mon, 28 Apr 2008 05:36:00 -0700, Dr. S <Dr.
wrote:

Having a column with 10 digit alphanumeric data (ie H1187600) I need to add
dashes after the 2nd and the 6th digit to look like H1-1876-00.
Shouldn't be difficult?


Your description and example don't match.

You describe -- 10 digit alphanumeric data; your example shows a single alpha
followed by seven digits.

You describe adding dashes after the 2nd and 6th digits; your example shows
dashes after the 1st and 5th digits.

Given your example, the following will give the result from your source data:

=LEFT(A1,1)&TEXT(MID(A1,2,99),"0-0000-00")

but if your actual data doesn't match your example, you'll have to be more
specific.
--ron

Teethless mama

How to add "-" into 10 digit numbers
 
=REPLACE(REPLACE(A1,3,,"-"),8,,"-")


"Dr. S" wrote:

Having a column with 10 digit alphanumeric data (ie H1187600) I need to add
dashes after the 2nd and the 6th digit to look like H1-1876-00.
Shouldn't be difficult?



All times are GMT +1. The time now is 05:27 AM.

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