The REPT function returns a supplied text string, repeated a specified number of times.

Syntax

=REPT(text,num_times)

Arguments

Argument Description
text The string to be repeated
num_times Thenumber of times that the supplied text isto be repeated

      If num_times is zero, the function returns an empty string
  If num_times is a decimal, it is truncated to an integer

Examples

  A B C D  
1 Text Times Function Results Notes
2     =REPT(“/”,10) //////////  
3 5 =REPT(A2,B2) —– Repeat hyphen 5 times
4 xo 3 =REPT(A3,B3) xoxoxo Repeating more than one character
5 *   =”<!– “&REPT(A5,8)&” –>” <!– ******** –> Combining the CONCATENATE and REPT functions
6 Joe 6 =A6&REPT(“*”,C6-LEN(A6))) Joe****** Using REPT with LEN to pad with asterisks

Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if the result of the REPT function is longer than 32,767 characters