adding a trailing zero

S

Sammy

I have a column that contains 4 digit numbers
0001
0011
1111
etc.
what I need is a function that will add a zero to this
number if the first digit is a zero and leave the rest
alone
exp. if the first number in A1 is = to "0" (0001) the add
a zero so the number is now (00001), if the first number
is not a zero (1111) do nothing

thank you for any help!
 
M

Myrna Larson

Your message subject says trailing zeroes. Your example shows a leading zero.
I'm not sure which you want.

Are your entries numbers or text? Did you achieve the leading zeroes by
formatting? If so, they are numbers, and you can just change the format:

[<1000]00000;0000

If you meant trailing zeroes, and you don't want to multiply the numbers by
10, use this format

[<1000],0000"0";0000
 
A

Andy Brown

exp. if the first number in A1 is = to "0" (0001) the add
a zero so the number is now (00001), if the first number
is not a zero (1111) do nothing

These values are text format already?

=IF(LEFT(A1,1)="0",0&A1,A1)

Rgds,
Andy
 

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