ExcelFunctions.net Logo

The Excel REPT Function

Home » Excel-Built-In-Functions » Excel-Rept-Function

Search this site:
Custom Search


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

The format of the function is :

Rept( Text, Number_times )

Where the arguments are as follows :

Text - The string to be repeated
Number_times - The number of times that the supplied Text is to be repeated.
Note :
     -    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.


Examples

The following spreadsheet shows several examples of the Excel Rept function. The format of the function is shown in the spreadsheet on the left and the result is shown in the spreadsheet on the right.

 Formulas
Examples of use of the Excel Rept Function
 Results
Excel Rept Function Results

Note that in the above examples:

  • In cell B2, the Number_times argument is set to 0, so the Rept function returns the empty string
  • In cell B4, the the '&' operator has been used with the Rept function, to join together different text strings





Valid XHTML 1.0 Transitional

Disclaimer Privacy Policy

Copyright © 2008-2010 ExcelFunctions.net