REPT
Definition
Returns specified text repeated a number of times.
Sample Usage
REPT("ha",4)
REPT(A2,3)
Syntax
REPT(text_to_repeat, number_of_repetitions)
text_to_repeat
- The character or string to repeat.number_of_repetitions
- The number of timestext_to_repeat
should appear in the value returned.- The maximum number of repetitions is 100. If
number_of_repetitions
is greater than 100,REPT
will only repeat the text 100 times.
- The maximum number of repetitions is 100. If
Notes
REPT
does not insert spaces between repetitions oftext_to_repeat
. If spaces are desired, a space must be appended to the end of the value oftext_to_repeat
. The resulting return value fromREPT
will have at least one trailing space, which may be removed withTRIM
.
See Also
TRIM
: Removes leading and trailing spaces in a specified string.
SUBSTITUTE
: Replaces existing text with new text in a string.
SPLIT
: Divides text around a specified character or string, and puts each fragment into a separate cell in the row.
In order to use the REPT formula, begin typing the formula in the area you would like to display the outcome:
A
|
B
|
|
---|---|---|
1
|