How can I prefill a text field with leading 0s?

S

Sweetetc

I have a list on Text data
ie 1, 14, 203, etc
I want them all to be 6 charcters long.
ie 000001, 000014, 000203, etc.
I can concatenate but the I would manually need to remove extra 0's Any
suggestions
 
B

Bob Phillips

Set the format to 000000 (Format>Cells>Custom)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
D

Duke Carey

If it is for display purposes, you can format (numbers, not text) using a
custom format of "000000"

If you need the values to 6 characters you can use for numeric values:
=text(number, "000000")

For text values:
=rept("0",6-len(text value))&text value
 
S

Sweetetc

Duke

Thanks the TXT seemed to do the trick. I could not get the REPT to work
correctly
 
Top