Copying a Number from one cell to another in a different format

Rodster1966

New Member
Joined
Sep 23, 2009
Messages
21
Hi Excel Gurus,

Can I please have your assistance.

I have a column of numbers 'A' that I need to copy to Column 'B' but they need to come across in a different format as follows:


Column A

000200501410


Column B

2-501410


Column A

001000499489


Column B

1-499489


In both of the above cases I need to delete or omit the first 2 or three 'Zeros' with the '-' Dash after the first digit.

Could you please show me how this can be achieved.

This is quite urgent so your assistance would be greatly appreciated.

Kind Regards

Rodney
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Is it always the first non zero number, a dash then the last 6 numbers?
 
Upvote 0
If it isnt this should cover it anyhow:

=LEFT(0+A1,1)&"-"&0+RIGHT(A1,LEN(0+A1)-1)
 
Upvote 0
Sorry Steve I have only just seen your reply and many thanks.

The number will invariably start with the following sequence:

eg. 1000508648

My Accounting Program only accepts 8 digits, so I need to convert the above number to:

1-508648

Another eg can be: 1200505106

This will need to be converted to:

12505106 (8 digits)

Many thanks

Rodney
 
Upvote 0
How about giving more examples that are fully representative of the data with expected results as it seems the goalposts have moved.
 
Upvote 0
I agree with Steve that more, varied examples would be useful. However, just guessing from what you have posted so far...

=LEFT(SUBSTITUTE(REPLACE(A1,LEN(A1)-5,6,""),0,"")&"-",2)&TEXT(RIGHT(A1,6),"000000")
 
Upvote 0
My apologies for the late reply but I just want to thank both of you, Steve and Rick, I have tested both formulas and both do the job fine so many thanks, I truly appreciate your assistance :)).


Kind Regards

Rod
 
Upvote 0

Forum statistics

Threads
1,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top