adding dashes

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Adding dashes

Adding dashes

resolvedResolved · Low Priority · Version 2010

Sophie has attended:
Excel Advanced course

Adding dashes

Hi

I am trying to convert the number on the left to the number on the right with underscore and dashes.

I have lots of cells that I need to do this to.

DH000172514 23 D_H0001-725-14

I went to format cells and custom and did #_####-###-## but my sample did not change - what am I doing wrong?

Thanks

Sophie

RE: adding dashes

Hi Sophie

Part of the problem is that DH0001... is not a Number
If you change the format as you suggested, it will work for all numbers but not numbers and letters.

It might be helpful to write a formula that adds in the "_" and the "-" to the character string

If you put this into A1
DH00017251423DH000172514

Paste this into B1
=CONCATENATE(LEFT(A1,14),"_",MID(A1,15,5),"-",MID(A1,20,3),"-",RIGHT(A1,2))

It should make it look like
DH00017251423D_H0001-725-14

This splits the Ref Number into the 4 parts and adds the underscore and dashes at each stage.

You can then copy and paste the "converted" ref over the top of the original (Paste special, Values/123)

Let me know if we can help you further with this.


Kind regards

Richard Bailey
Microsoft Certified Trainer

Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Mon 17 Oct 2016: Automatically marked as resolved.


 

Excel tip:

Create Equations in Excel 2010

Here's how to create basic mathematical
equations in your Excel 2010 worksheet.

1) On the Ribbon, click the Insert tab
2) In the Symbols group, click the arrow next to Equation
3) Select from the equations and the equation will be inserted in a text box

Or you can create your own equation:

1) Insert and select the text box
2) On the Ribbon, click the Insert tab
3) In the Symbols group, click Equation
4) The Equation Tools Design Ribbon will now be displayed

View all Excel hints and tips


Server loaded in 0.06 secs.