How to Repeat Text in Excel and Google Sheets (REPT Function)
Both Excel and Google Sheets repeat text with the same function: REPT. It takes the text and a repeat count, returns the copies joined together with nothing between them, and fails with a #VALUE! error once the result grows past roughly 32,000 characters.
The REPT syntax
The syntax is identical in both applications:
=REPT(text, number_times)
Both arguments are required. text is the string to repeat, and number_times is how many copies you want. Entering =REPT("ha", 4) returns hahahaha.
Two behaviours catch people out. If number_times is a decimal, it is truncated to a whole number, so 2.9 becomes 2. If it is 0, the function returns an empty string rather than an error.
Character limits differ between the two
This is the most common reason a REPT formula suddenly breaks. The two apps do not share the same ceiling.
| Application | Maximum REPT output | Error when exceeded |
|---|---|---|
| Microsoft Excel | 32,767 characters | #VALUE! |
| Google Sheets | 32,000 characters | #VALUE! |
| Easy Text Repeater | No fixed cap; warns above 1,000,000 | None |
In Excel the 32,767 figure is the maximum length of a cell, so REPT cannot exceed it. Google Sheets allows up to 50,000 characters in a cell overall, but the REPT function itself stops at 32,000, which means you can hit the function's limit while the cell still has room.
The practical effect: repeating a 40-character sentence maxes out at about 800 copies in Excel and slightly fewer in Sheets.
REPT adds no separator
REPT joins copies directly with nothing in between. =REPT("cat", 3) returns catcatcat, not cat cat cat.
To get spacing you have to build the separator into the text itself:
| Formula | Result |
|---|---|
=REPT("cat", 3) | catcatcat |
=REPT("cat ", 3) | cat cat cat (trailing space) |
=REPT("cat, ", 3) | cat, cat, cat, (trailing comma) |
Notice the trailing separator in the last two rows. REPT has no concept of "between", so the separator is appended after every copy including the final one. Removing it takes another layer of formula, usually LEFT combined with LEN:
=LEFT(REPT("cat, ", 3), LEN(REPT("cat, ", 3)) - 2)
That returns cat, cat, cat with the trailing comma and space trimmed.
Repeating onto separate lines
A common need is one copy per line. Inside a single cell you can use CHAR(10) in Excel on Windows, and you must also enable Wrap Text for the breaks to become visible:
=REPT("cat" & CHAR(10), 3)
This still counts toward the same character limit, and the result stays trapped in one cell. If your goal is a block of text to paste elsewhere, a spreadsheet is a slower route than a dedicated tool.
When a web tool is the faster route
REPT is the right choice when the repeated text is part of a larger spreadsheet calculation, such as building in-cell bar charts with =REPT("|", A1).
It is the wrong choice when you simply need a block of repeated text to copy somewhere else. In that case you are opening a spreadsheet, writing a formula, nesting a second formula to strip the trailing separator, and then still having to copy the cell contents out.
Easy Text Repeater does the same job in one step: enter the text, set the count, pick a separator, and copy or download the result. Separators are inserted between copies rather than after every copy, so there is no trailing character to trim, and there is no 32,000 character ceiling.
Need the repeated text outside a spreadsheet? Skip the formula and generate it directly, with new line, space, comma or custom separators.
Frequently asked questions
What is the formula to repeat text in Excel?
The formula is =REPT(text, number_times). For example, =REPT("ab", 5) returns ababababab. The same formula works in Google Sheets.
Why does my REPT formula return #VALUE!?
The result exceeded the character limit. Excel caps REPT output at 32,767 characters and Google Sheets caps it at 32,000. Reduce the repeat count or shorten the text you are repeating.
How do I add a space between repeated text in Excel?
Include the space inside the text argument, as in =REPT("cat ", 3). REPT does not insert separators on its own, so this also leaves a trailing space after the last copy that you may need to trim.
Can REPT repeat text onto separate lines?
Yes, by appending a line break character: =REPT("cat" & CHAR(10), 3). You must turn on Wrap Text for the cell before the line breaks become visible.