The Excel function of REPT is used to repeat a text value in a recurring manner up to the specified number of times. This function is a string/text function that can be entered as a part of the formula in a worksheet cell.
Figure 1: REPT Function
The syntax of the REPT function in Excel is:
The parameters of this function are:
- Text – the text value to be repeated
- Num – the number of times the text is to be repeated
The return of this function is the repetitions of the string or the text value.
In the above example, the text parameter in the cell B5 is “-“ that has been specified to be repeated four times in the cell C5. The REPT function is then used in the next cell that repeats the value of “-“ to four times. It is the case in cell B6 where the text is “xo” that has been specified to return the value two times resulting in the display of “xoxo”.
- The REPT function is used to repeat the text up to a specified number of times, so it is especially useful when the user needs to fill a cell. Can also pad the values to a certain length
- Padded characters are shown with an “*” after the original text has been repeated to fill the return value