If the original number contains 2 digits, 3 zeros are added.

If the original number contains 3 digits, 2 zeros are added, and so on.

The best approach depends on your needs.

Format Cells dialog box

If numbers really should be text values, use Option 1.

If numbers need to remain numeric values, use Option 2.

Both options are easy to implement, but Option 1 is more flexible.

Format Cells dialog box

The TEXT function returns a number formatted as text, using thenumber formatprovided.

Note that Excel willautomaticallyalign text values to the left, but you could manually set alignment as desired.

The key thing to understand with this option is that the numeric values underneath arenot affected.

Format Cells dialog box

Applying a number format only changes the way the numbers aredisplayed in Excel.

When you click “OK” the number format is applied and numbers are displayed with leading zeros.

The key difference is that Option 1 results intext, while Option 2 preserves thenumber.

Format Cells dialog box

Be aware that you may need to cater to this difference in other formulas.

The formulas below show how this difference affects a VLOOKUP formula:

More on VLOOKUP here.

in a text string with the number format of your choice.

Format Cells dialog box

How to combine functions in a formula

Shortcuts for paste special

Select Number > Custom

Numeric values unchanged by number format

Excel formula: Pad week numbers with zeros

Excel formula: Pad a number with zeros

Excel TEXT function

Article image

Article image