REPT

The REPT function returns a text repeated a certain number of times. This function is useful, for example, to fill a cell with the same text string.

Syntax

REPT(
    text,
    num_times
)

Parameters
  • text: Text to repeat or name of the column containing the texts to be repeated.
  • num_times: Number of times you want to repeat the text text .
Returned value

REPT returns a text string made up of repeating text as many times as indicated by the num_times argument.

Additional Information

num_times must be a number greater than or equal to zero. Otherwise the REPT function will return an error. If num_times is not an integer, it is truncated to consider only the integer part.

If text is not a text string, REPT will convert it to text.

If text is an empty string, REPT also returns an empty string.

If num_times is zero, REPT returns an empty string.

The maximum length of the text string returned by REPT is 2,097,151, giving an error if this figure is exceeded.

Examples

In this example, the result of repeating several text strings is obtained:

REPT function: Example of use

If the text argument is not a text string, the REPT function converts it to text and repeats it as many times as specified. For example, if it is a whole number:

Valor = REPT(12, 3)

Función REPT

Or if it is a date:

Valor = REPT(DATE(2020,10,30), 3)

Función REPT
Category
Text
Submitted by admin on Mon, 12/03/2018 - 23:54