Defined number of characters

G

Guest

I have a spreadsheet that has numerical values in cells of different lengths,
ie xxx, xxxxxx, etc. I need to make all the values 6 characters long by
adding or removing zeros at the beginning and therefore not altering the
value. I then want it to appear as text rather than number. Can anyone help
 
G

Guest

Try someting like:

=IF(LEN(A1)<=6,TEXT(A1,"000000"),TEXT(RIGHT(A1,6),"000000"))

HTH
JG
 

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