Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to convert 1, 11, 111, and 1111 to 0001, 0011, 0111, and 1111, and then append some text to the resultant. I know how to format the cells as custom 4 digits, but this does not allow me to use them in a formula and append text.

share|improve this question
Do you need to always append the same text or will it vary? – Christophe May 25 '14 at 15:07
@ChristopheC Text is appended from a different column. LDC3's solution works. – user1032531 May 25 '14 at 15:09
up vote 9 down vote accepted

To add leading zeros, use the TEXT function:


enter image description here

To append text, use &

= C1&B1

enter image description here

share|improve this answer

I'm using LibreOffice, but you should have these functions in Excel:

=CONCATENATE(TEXT(A1,"0000")," ",A2)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.