ID EN
#Text

REPT

Excel Functions

Repeat text as specified

Syntax

EXCEL
=REPT(text, number_times)

Arguments

Parameter Description
text The text to repeat.
number_times The number of times to repeat text.

Return Value

The repeated text.

Details

The REPT function repeats characters a specified number of times. Although REPT can repeat numbers as well as text, the result from REPT is always a text value. REPT takes two arguments, text and number_times. Text is the character(s) to repeat, and number_times is the number of times text should be repeated. REPT can be used to pad values to a certain length or to build a simple in-cell histogram. To pad numeric values with zeros, a custom number format may be a better option. To repeat "x" five times, you can use the following formula: Inputs to REPT can be variable. In the example shown above, REPT is configured to repeat the values in column B using the count in column C. The formula in D5 is: REPT can be combined with other functions to calculate a variable count. For example, to pad

Examples

Examples

To repeat "x" five times, you can use the following formula:

EXCEL
=REPT("x",5) // returns "xxxxx"
Examples

Inputs to REPT can be variable. In the example shown above, REPT is configured to repeat the values in column B using the count in column C. The formu

EXCEL
=REPT(B5,C5) // returns "-----"
Examples

REPT can be combined with other functions to calculate a variable count. For example, to pad a text string with a specific character so that all strin

EXCEL
=A1&REPT("*",count-LEN(A1))

See Also

FIND REPLACE