Explanation

In this example, the goal is to pad a number with zeros.

Fixed number

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

The TEXT function can apply number formats of any kind to numbers.

Excel formula: Pad week numbers with zeros

To simplydisplaya number with padding, you might use a regularnumber format.

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

REPT Function

The Excel REPT function repeats characters a given number of times.

Excel formula: Add leading zeros to numbers

For example, =REPT(“x”,5) returns “xxxxx”.

Excel TEXT function

Excel REPT function