Features of !SEMTools

REPT

REPT function in Excel examples
Simplest examples of using the REPT function
Function categoryText
VolatilityNon-volatile

What does this function do?

This function repeats a text fragment a specified number of times.

You need to specify the text to repeat and how many times to repeat it.

In the latest versions of Excel, the function will return a #VALUE! error if the returned value exceeds 32767 characters.

Syntax

=REPT(Text, Number_times)

Application examples

Example 1

REPT function as sparklines alternative
REPT function in Excel as sparklines alternative

The table above was used to create a simple histogram of sales indicators.

The REPT function uses the sales value divided by the maximum value from the same table so that the number of repetitions doesn’t exceed 100.

To prevent spaces from displaying between the “l” symbols, the Playbill font was used.

This example is most useful for compatibility with Excel versions before 2010, since they didn’t yet have the “Sparklines” tool.

Example 2

The REPT function is used in a complex formula to extract words containing a specific character.

The function is used to create a sufficiently large number of spaces between words (99 in this case).

Using the REPT function makes the formula more compact.

REPT function in complex formula example

See examples of such usage in the articles:

MID function

VALUE function

Like the article? Help its author! Buy !SEMTools, it has lots of useful instruments to process text data.

This post is also available in RU.