REPT Function in Google Sheets: Explained
In this article, you will learn how to use the REPT formula in Google Sheets.
What is the REPT function in Google Sheets?
The REPT formula allows you to repeat a particular text string a specified number of times. For instance, the REPT function is beneficial when you want to repeat a specific sign, such as a star, to visualize scores in a list.
How to use the REPT formula in Google Sheets
- Type “=REPT(” or go to “Insert” → “Function” (or directly navigate to the “Functions” icon) → “Text” → “REPT”.
- Input text to repeat by manual input or cell reference and define the number of repetitions.
- Press the “Enter” key.
The generic formula is as follows:
Text_to_repeat: A string to be repeated
Number_of_repetitions: This determines how many times the formula repeats the selected text
Note 1: You need to enclose the text string with quotation marks when you input a text line in the argument manually.
Note 2: The REPT function doesn’t provide any whitespace between the repeated words unless whitespace(s) is included in the selected text string. If you need to trim extra spaces from the original texts, you can use the TRIM function or Google Sheets’ data cleaning feature. To learn them, check this article: How to Trim Whitespaces in Google Sheets.
Look at the examples in the following picture to better understand how the REPT function works in Google Sheets. Assume you want to visualize each customer’s rank by a special symbol, such as a star mark.
The syntax of the formula in cell D3 is as follows:
Text_to_repeat: CHAR(11088)
Number_of_repetitions: C3 (=3)
In this sample formula, a star symbol is chosen text to be repeated. As the formula refers to cell C3 containing 3, it repeats the star symbol three times in a cell. The CHAR function is a formula used to call a special symbol, text, or Emoji from the Unicode table. If you are interested in learning the CHAR function, check this article: CHAR Function in Google Sheets: Explained
How do I apply the same function to multiple cells in Google Sheets?
You can copy a formula in a cell and paste it on the other cells. You can also use Google Sheets’ auto-completion function. To learn the function, navigate to this article: Autofill Function in Google Sheets: Explained