Excel – Make number a given number of digits using Excel

microsoft excel

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.

Best Answer

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

Related Question