REPT
TheREPT
formula repeats a given text a specified number of times. It is most commonly used to create a string of repeated characters or a repeated pattern.
- How to use
REPT
formula? - Examples of using
REPT
formula REPT
formula not working?- Similar formulas to
REPT
Usage
Use the REPT
formula with the syntax shown below, it has 2 required parameters:
- text_to_repeat (required):
The text or cell reference to the text that you want to repeat. - number_of_repetitions (required):
The number of times you want the text to be repeated. Must be greater than or equal to 0.
Examples
Here are a few example use cases that explain how to use theREPT
formula in Google Sheets.
Create a border
To create a simple border in your sheet, you can use the REPT
formula to repeat a specific character a certain number of times. For example, you can use =REPT("-",10)
to create a row of 10 dashes.
Create a progress bar
You can use the REPT
formula to create a progress bar in your sheet. For example, if you have a percentage value in cell A1, you can use =REPT("|",A1/10)
to create a progress bar with each pipe character representing 10%.
Repeat a pattern
You can use the REPT
formula to repeat a pattern of characters or text. For example, you can use =REPT("AB",5)
to repeat the pattern "AB" five times.
Common Mistakes
REPT
not working? Here are some common mistakes people make when using the REPT
Google Sheets Formula:
Using a negative number of repetitions
The number_of_repetitions
argument must be a non-negative integer. If a negative number is used, REPT
will return an error.
Providing a non-numeric value for number of repetitions
The number_of_repetitions
argument must be a non-negative integer. If a non-numeric value is used, REPT
will return an error.
Related Formulas
The following functions are similar to REPT
or are often used with it in a formula:
-
CONCAT
The CONCAT formula in Google Sheets is used to combine two or more strings or cell values into a single string. It is most commonly used to join values from different cells or to create a custom message or label. The operator CONCAT can also be used in combination with other formulas to manipulate the joined values.
-
LEFT
The
LEFT
formula is used to extract a specific number of characters from the beginning of a text string. It is most commonly used to extract the first name or last name from a full name or to extract a date from a text string. -
MID
The MID formula in Google Sheets is used to extract a specific number of characters from a string, starting at a specified point. This is useful when working with large datasets and you only need a portion of the information in a cell. The formula takes in the string to extract from, the starting point, and the length of characters to extract as arguments.
-
RIGHT
The
RIGHT
formula in Google Sheets returns the rightmost characters from a string, based on the number of characters specified. It is commonly used to extract a certain number of characters from the end of a string. The formula takes two arguments: the string from which to extract the characters, and the number of characters to extract. -
LEN
The
LEN
formula in Google Sheets is used to count the number of characters in a given text string. It is commonly used to check the length of text inputs, or to find the length of a cell value or range.
Learn More
You can learn more about the REPT
Google Sheets function on Google Support.