How to Repeat Text in Word and Excel
To repeat text in Excel, use the REPT function: =REPT("text", 5) writes the text five times in one cell. Google Sheets has the same function. Word has no such function, so there you repeat the last action with Ctrl+Y or F4.
This guide shows how to repeat text in Excel, Google Sheets and Word, the rules and errors of REPT, and when a browser tool does the job faster.
How to repeat text in Excel with REPT
REPT is an Excel function that repeats a text a given number of times. Microsoft Support gives the syntax as REPT(text, number_times).
- text is the text you want to repeat. Put it in double quotes, or use a cell such as A1.
- number_times is how many times to repeat it. It must be a positive number.
| Formula | Result | Note |
|---|---|---|
| =REPT("-", 10) | ---------- | Ten dashes, example from Microsoft Support |
| =REPT("*-", 3) | *-*-*- | Example from Microsoft Support |
| =REPT("ha", 3) | hahaha | No space between the copies |
| =REPT(A1, 4) | The text of cell A1, four times | A cell instead of typed text |
- Click an empty cell.
- Type the formula, for example =REPT("ha", 3).
- Press Enter. The cell shows the repeated text.
REPT rules and errors
REPT has three rules, all stated by Microsoft Support.
| Case | What Excel does |
|---|---|
| number_times is 0 | Returns empty text |
| number_times is not a whole number, such as 3.9 | Cuts off the decimals and repeats 3 times |
| The result is longer than 32,767 characters | Returns the error #VALUE! |
The third rule sets the ceiling. A text of 10 characters repeats at most 3,276 times in one cell, because 3,277 copies would be 32,770 characters.
How to add a space or a comma between copies
REPT has no separator. Google's help page for the function says it plainly: REPT does not insert spaces between repetitions. So the separator has to be part of the text itself.
| Formula | Result | At the end |
|---|---|---|
| =REPT("ha ", 3) | ha ha ha | One extra space |
| =REPT("ha, ", 3) | ha, ha, ha, | One extra comma and space |
| =TRIM(REPT("ha ", 3)) | ha ha ha | Nothing extra |
The separator comes after every copy, also after the last one. TRIM removes a space at the end, but not a comma. For a clean list with commas, a tool that puts the separator only between the copies is easier.
What is REPT used for in a spreadsheet?
REPT is mostly used to build something from a number in another cell. Two uses are common.
| Use | Formula | Result |
|---|---|---|
| A simple bar next to a number | =REPT("|", B1) with 7 in B1 | ||||||| |
| Zeros in front of a number | =REPT("0", 5-LEN(A1))&A1 with 42 in A1 | 00042 |
In the first formula the bar grows with the number, so a column of such cells reads like a small chart. In the second formula REPT writes as many zeros as are missing to reach five digits.
How to repeat text in Google Sheets
Google Sheets uses the same function. Google Docs Editors Help gives the syntax as REPT(text_to_repeat, number_of_repetitions).
- Same formulas. The examples from the Excel section work in Google Sheets without a change.
- No separator. As in Excel, a space or a comma goes inside the text.
- Length limit. The result cannot be longer than the character limit of a cell. Google's help page gives 32,000 characters and the error #VALUE! above it.
How to repeat text in Word
Word has no REPT function. It has a Repeat command that does the last action again. Microsoft Support gives two keys for it: Ctrl+Y or F4.
- Copy the text you want to repeat.
- Paste it once in the document with Ctrl+V.
- Press Ctrl+Y or F4. Word repeats the paste. Press it again for each new copy.
Not every action can be repeated. In that case the command shows "Can't Repeat", as Microsoft Support explains. The same two keys work in Excel and PowerPoint.
This way is fine for a few copies. For 100 copies you press the key 99 times and count them yourself.
When an online text repeater is faster
REPT is the right choice when the repeated text has to stay inside a spreadsheet. For text that goes somewhere else, a text repeater tool in the browser saves steps.
| REPT in Excel | Our Text Repeater | |
|---|---|---|
| Longest result | 32,767 characters | 2,000,000 characters |
| Separator | Typed inside the text, also added after the last copy | Space, new line or your own text, only between the copies |
| Needs | Excel or Google Sheets | A web browser |
| Result | A value in a cell | Plain text with Copy and Download buttons |
For the background, see text repeater explained. If you repeat text to test a form or a database field, the guide on test data text lists useful strings.
Frequently asked questions
- What does REPT stand for?
- REPT is short for repeat. The function repeats a text a given number of times.
- Why does REPT show #VALUE!?
- In Excel the result is longer than 32,767 characters. Lower the number of repetitions or use a shorter text.
- Can REPT repeat the text of a cell?
- Yes. Use the cell as the first argument, for example =REPT(A1, 4).
- Does REPT work in Google Sheets?
- Yes. Google Sheets has the same function with the syntax REPT(text_to_repeat, number_of_repetitions).
- How do I repeat text in Word without a formula?
- Paste the text once and press Ctrl+Y or F4 to repeat the paste. For many copies, build the text in a text repeater and paste the result.