how do I add preceeding zeros

C

clarkld

I am using office 2003. I would like to add zeros to the beginning of numbers.
For example: 12345 to 0012345.
 
J

Jason Morin

If you wish to simply format the numbers, go to Format >
Cells > Number > Custom and use 0000000. Or you actually
convert them to text with:

=TEXT(A1,"0000000")

HTH
Jason
Atlanta, GA
 
K

KL

If you want your number to remain a numeric value, you'll need to use cell
format: press Ctrl+1, select the Number Tab, choose CUSTOM from the
categories list and enter the following in the box called Type: 000000#

If it is OK for your number to become text, then use the TEXT() function.
E.g. if cell A1 contains 12345 the formula =TEXT(A1,"000000#") will return a
text string which will look like this 0012345. To convert it back to number
you can use the VALUE() function: =VALUE("0012345") will return 12345 as a
numeric value.

Hope this helps,
KL
 
P

PeterAtherton

Clark

Format, Cells, Number, Custom and enter 7zeros in the textbox

Peter Atherton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top