REPT function

REPT() function

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

Repeat a specific text string by a number of instances.

REPT(text, number_times)


Repeat a text string or number by a number of instances, using either defined values (e.g. "string") or cell references (e.g. C3).

REPT syntax requires the defined value or cell reference to be repeated and the number of times to repeat it.


REPT with a text string.

In the example below, the REPT function is used to repeat different characters a different number of times. You can create simple histograms using different symbols, characters or fonts (such as the use of Wingding below).

Use the REPT function to repeat a text string by a number of instances.

Use the Excel function REPT to repeat a specific text string by a number of instances.

REPT with a number.

In the example below, the REPT function is used to repeat different numbers a different number of times. Currency symbols are not repeated (unless enclosed in quotes).

Use the REPT function to repeat a number by a number of instances

Use the Excel function REPT to repeat a specific number by a number of instances.

Syntax

The REPT function consist of 2 arguments:

  1. text. Required. The text to be repeated.
  2. number_times. Required. The number of times the text is to be repeated.

Try it now!

Enter your formulas into the grey cells.


Scope

REPT() can be applied to cell references, text or numbers.

  • Cell reference:
  =REPT(C3,5) || returns ***** where cell C3 contains the character '*'.
  • Text:
  =REPT("*",5) || returns *****.
  • Number:
  =REPT(123,3.99) || returns 123123123. number_times is not an integer so is truncated to 3x.

Caveats

number_times:

  • If number_times is negative, a #VALUE! error is returned.
  • If number_times is zero, empty text ("") is returned.
  • If number_times is a non-integer, the values after the decimal point are ignored.
  • The result of the REPT function can not be longer than 32,767 characters or REPT returns a #VALUE! error.

Functions Category

 

Register (for free!) or Login to access bonus materials

About xlsnippets

Learn how to master functions, charts, pivot tables and more using Excel for Microsoft Office 365. Simple instructions and embedded spreadsheets help you practise the basics.

Latest Updates

26 March 2022
26 March 2022
26 March 2022
25 March 2022
22 March 2022

Coming soon

xlsnippets.com is currently in beta version. More functions and bonus content for registered users will be added weekly. Detailed training courses with additional downloadable resources are also on the horizon!