Repeats a string specified number of times.
= REPT(str, numberOfTimes)
str |
A string which has to be repeated. The value can be specified as a decimal value (e.g., 37.48), as a string (“Word”), as the value of a variable (e.g, FirstName), or as a Date (“02/19/2009”). |
numberOfTimes |
A positive integer indicating the number of times the string should be repeated. |
String
In the case of an error, the function displays an error message: “REPT(str, numberOfTimes): Error message”
The function can be used in combination with other functions.
Example |
Returns |
= REPT(“*”, 4) |
**** |
= REPT(UnitPrice, 3) |
A string containing the value of UnitPrice repeated thrice. |
= UPPER(REPT(“Iron Speed Designer”, 2)) |
The upper case version of the repeated string. |
= CONCATENATE(“Rating: “, REPT(“*”, 4)) |
A concatenated version of the repeated string with the passed string. |