Add Hyphens to alphanumeric sting of data in Excel 2016

0

Hello - I want to format this string in a cell to go from DAAB0708DD001 to DAAB07-08-D-D001  How can I do this using a formula.

Thank you! 

Answer
Discuss

Answers

0
Selected Answer

I started with your string (DAAB0708DD001) in Cell A1, then in B1 I used the formula " =LEFT(A1,6)&"-"&MID(A1,7,2)&"-"&MID(A1,9,1)&"-"&MID(A1,10,5)"  [without the quotes].  you use the apersand character "&" as concatenating, the create string forumlas to connect the rest with the dash "-" character in between.

Discuss

Discussion

Thank you! Worked perfectly. 
Cindy525469 (rep: 4) Aug 28, '17 at 1:37 pm
Add to Discussion
0

Or a shorter version.

=REPLACE(REPLACE(REPLACE(A1,7,0,"-"),10,0,"-"),12,0,"-")

Discuss

Answer the Question

You must create an account to use the forum. Create an Account or Login