The Excel REPT Function

Function Description

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

The syntax of the function is:

REPT( text, number_times )

Where the arguments are as follows:

text-The string to be repeated.

The number of times that the supplied text is to be repeated.


  • If number_times is zero, the function returns an empty string;
  • If number_times is a decimal, it is truncated to an integer.

The resulting text string must be no longer than 32,767 characters. If it is longer than this, the Rept function returns the Excel #VALUE! error.

Rept Function Examples

The following spreadsheet shows three examples of the Excel Rept function.

1=REPT( "ha", 8 )
2=REPT( "ha", 0 )
3="/ " & REPT( "*", 20 ) & " /"
3/ ******************** /

Note that in the above example spreadsheet:

For further examples of the Excel Rept function, see the Microsoft Office website.

Rept Function Error

If you get an error from the Excel Rept Function, this is likely to be the #VALUE! error:

Common Error
#VALUE!-Occurs if the result of the Rept function is more than 32,767 characters long.