leading zeros go missing

EDUCATED MONKEY

Board Regular
Joined
Jul 17, 2011
Messages
218
Win xp professional office xp 2003 ie 8
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p> </o:p>
Leading zero’s are missing when I format the cells as number, were as they are present if I format as text!
Normally this would no cause a problem, in this case however I am converting ISBN number firstly with a formula obtained from “dynamicorange.com” which work’s fantastically in either 10 digit to 13 digit and vice versa
The problem arises when the number is broken down into its component parts to place hyphens between the groups of numbers, again I have this working, provided the number does not have a leading zero
To give an example 1840462507 gets converted correctly to 1-84046-250-7 as well as many others
On the other hand if the number is say
0431098360 this ends up as 431098360 so when the mid function operates on it the wrong result is returned <o:p></o:p>
<o:p> </o:p>
I have not posted any code as it is all excel lefts rights mids Len’s nested IF AND etc so it would serve no purpose
I just need to be able to retain the leading zeros which will solve the problem
Any ideas ?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
You could format the cells as text.

Or leave them as numbers and use =text(A1, "0-00000-000-0") to convert to ISBN format.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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