The REPT function in Google Sheets is useful if you want to repeat a text several times.
The function returns a set number of texts listed within the google sheets.
Table of Contents
Let’s take an example:
There are many ways to use the
REPT function, but here are the two main ways to show an easy demonstration.
As you can see, A2 is the given text that we want to repeat, B2 is the number of times we want to repeat the text.
By using the REPT function, C2 would return the word “Shampoo” six times.
You can also use the function by directly inputting the
text you want to show as a result.
By inputting “|” directly into the formula, the function will return the amount of “|” implicated in B2.
Here is an example to show you how to incorporate
SPLIT function into
By adding the
SPLIT function, it makes the
REPT function the
text in the formula, followed by the
delimeter, a character we use to split the text into different columns.
This formula will return each “|” in different columns.
You can also use
REPT function just like an
IF function in some situations as a logical formula.
To have a more visual spreadsheet to analyze which items are in need of restocking, we can use the
REPT function to only show the items that are low in stock.
Instead of only putting the numbers to repeat, we put in a logical argument to only show “Low Stock” if the item is left with less than 4 units.
The Anatomy of the REPT Function
The way we write the REPT function is:
Let us help you understand the context of the function:
- The equal sign
=is how we start any function in Google Sheets.
REPT()is our function. We need to add two attributes, namely the
number_of_repitition, to make it work correctly.
text_to_repeatis the text/ character to repeat.
number_of_repititionis the number of times
Let’s take note that:
REPT function does not insert spaces between repetitions of the
text_to_repeat. If the spacing is desired, a space must be inserted to the end value of the
A Real Life Example of Using REPT Function
REPT function is often used as a visualization for ease of understanding a set of data, such as this:
By using the
REPT function, you can easily tell which pastries are the best-selling items!
You can create many different styles of in-cell charts to beautify your Google Sheet! Sweet!👌
How to Use REPT Function in Google Sheets
- Simply click on the cell that you want to write down your function at. In this example, it will be C2.
- Begin your function with an equal sign
=, followed by the name of the function,
REPT, then an open parenthesis
- We will then add the character that we want to add. In our case, it’s the 🥐 emoji. To access the Emoji Keyboard Panel, you can simply press the “Window key” + “.” simultaneously. This would then appear:
- Next, enclosed by a quote-unquote symbol
"", type in the character we want to repeat.
- Then, we will add another comma
,to separate the
number_of_repititionwhich will be B2. We end the formula by closing it with a parenthesis
Our final formula would look like this:
- After the following steps, your input should look like this.
You may make a copy of the spreadsheet using the link attached below and try it for yourself:
There you go! A fun way to show your data! 💪
Do subscribe to us for more upcoming interesting Google Sheets and Excel function tutorials!