Excel contains a special function for repeating text named REPT which stands for “repeat.”
If I expose these arguments on the worksheet, I can quickly add a few more examples.
In each case, Excel simply repeats the text you provide as many times as you specify.
So, what can you use the REPT function for?
Well, one thing you’ve got the option to do with REPT is build a simple histogram.
For example, here we have one-day sales for milkshakes broken down by flavor.
But if you want a dead-simple, in-cell chart, the REPT function is an easy option.
it’s possible for you to also use the REPT function to pad numbers and other text.
I’ll start off with a simple formula that repeats the zero six times.
Now we have the zeros and, usingconcatenation, I can join the zeros to the text.
That’s closer to what we want, but we don’t want six zeros plus the text.
We only want as many zeros as needed so that the final result is always six characters long.
When I copy this formula down, all results are exactly six characters long.
Although this example is padding text with zeros, I can use any other character I like.
For example, I could use an asterisk or a hyphen.