Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 C May 25 at 15:07
1  
@ChristopheC Text is appended from a different column. LDC3's solution works. –  user1032531 May 25 at 15:09

2 Answers 2

up vote 9 down vote accepted

To add leading zeros, use the TEXT function:

=TEXT(A1,"0000")

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

 
discard

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.