Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 10 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .