REPT()

Syntax. REPT(text,number_times)

Definition. This function repeats text a given number of times.

Arguments

  • text (required). The character or string you want to repeat

  • number_times (required). A positive number indicating how often the text is repeated

Background. Use the REPT() function to fill a cell with a specified number of instances of a text string. You can also use this function for chart-like illustrations in worksheets.

Also note the following when working with this function:

  • If number_times is 0, the REPT() function returns an empty string (“”).

  • If number_times is not an integer, the decimal places are truncated.

  • If number_times is a negative number, the REPT() function returns the #VALUE! error.

  • If the result exceeds 32,767 characters, ...

Get Microsoft® Excel® 2010 Formulas & Functions Inside Out now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.