ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Concatenate an Hyphen (https://www.excelbanter.com/excel-worksheet-functions/217346-concatenate-hyphen.html)

Michael[_2_]

Concatenate an Hyphen
 
Hi Folks - I have account numbers that look like this:


10000000-03108-111-20-2102-52207-1200
10000001-03109-111-10-0000-52207-1200
10000002-03109-111-10-1600-52207-1200

etc....

What's the easist way to insert an hyphen after the first 2 digits so things
look like this:

10-000000-03108-111-20-2102-52207-1200
10-000001-03109-111-10-0000-52207-1200
10-000002-03109-111-10-1600-52207-1200

Thanks,

Michael



Gary''s Student

Concatenate an Hyphen
 
=LEFT(A1,2) & "-" & RIGHT(A1,LEN(A1)-2)
--
Gary''s Student - gsnu200828


"Michael" wrote:

Hi Folks - I have account numbers that look like this:


10000000-03108-111-20-2102-52207-1200
10000001-03109-111-10-0000-52207-1200
10000002-03109-111-10-1600-52207-1200

etc....

What's the easist way to insert an hyphen after the first 2 digits so things
look like this:

10-000000-03108-111-20-2102-52207-1200
10-000001-03109-111-10-0000-52207-1200
10-000002-03109-111-10-1600-52207-1200

Thanks,

Michael




Glenn

Concatenate an Hyphen
 
Michael wrote:
Hi Folks - I have account numbers that look like this:


10000000-03108-111-20-2102-52207-1200
10000001-03109-111-10-0000-52207-1200
10000002-03109-111-10-1600-52207-1200

etc....

What's the easist way to insert an hyphen after the first 2 digits so things
look like this:

10-000000-03108-111-20-2102-52207-1200
10-000001-03109-111-10-0000-52207-1200
10-000002-03109-111-10-1600-52207-1200

Thanks,

Michael



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

Michael[_2_]

Concatenate an Hyphen
 
Awesome guys ... Thanks.

Michael


"Glenn" wrote in message
...
Michael wrote:
Hi Folks - I have account numbers that look like this:


10000000-03108-111-20-2102-52207-1200
10000001-03109-111-10-0000-52207-1200
10000002-03109-111-10-1600-52207-1200

etc....

What's the easist way to insert an hyphen after the first 2 digits so
things look like this:

10-000000-03108-111-20-2102-52207-1200
10-000001-03109-111-10-0000-52207-1200
10-000002-03109-111-10-1600-52207-1200

Thanks,

Michael



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





All times are GMT +1. The time now is 04:17 PM.

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