To repeat text inside a single cell in Excel or Google Sheets, use the built-in REPT function:
Both applications share the standard =REPT(text, number_times) syntax structure. To place each repetition on a separate line inside the same cell, concatenate CHAR(10) and turn on Wrap Text. To repeat text down multiple individual rows without dragging, formulas such as =IF(SEQUENCE(10), A2) in Excel 365 or =MAP(SEQUENCE(10), LAMBDA(n, A2)) in Google Sheets have their syntax checked in code; verify array formula support in your specific spreadsheet version.
Whether you are mocking up sample records, padding fixed-width files, building parameterized testing matrices, or repeating recurring delimiters across financial models, knowing how to duplicate strings directly inside your workbook saves hours of manual copy-pasting.
While formulas are ideal when your text needs to react dynamically to other cells in a workbook, opening heavy desktop software just to duplicate a short phrase is often unnecessary. For fast, one-off text duplication up to 10,000 times outside spreadsheets, a free browser-based text repeater generates and copies clean strings to your clipboard in one click.
The REPT Function: Syntax and Argument Rules
The REPT function is standard in spreadsheet software across Microsoft Excel and Google Sheets:
Argument 1: text
The string you want to repeat. You can supply a hardcoded string wrapped in double quotes (e.g., "Draft") or reference another cell (e.g., A2).
Argument 2: number_times
A positive integer specifying how many times to repeat. Can be a literal number or a numeric cell reference (e.g., B2).
Evaluation Rules & Edge Cases in Excel
How Excel handles unexpected boundary conditions per official Microsoft documentation:
| Input Scenario | Formula Example | Excel Result (Microsoft Documented) |
|---|---|---|
| Count of Zero | =REPT("X", 0) | Returns an empty text string (""). Documented in Microsoft Support article "REPT function". |
| Decimal / Float Count | =REPT("X", 2.8) | Truncated to integer (2.8 becomes 2, returning "XX"). Documented in Microsoft Support article "REPT function". |
| Negative Count | =REPT("X", -1) | #VALUE! (Documented in Microsoft Support article "REPT function") |
| SEQUENCE with 0 Rows | =SEQUENCE(0) | #CALC! (Microsoft documents rows ≥ 1 required in "SEQUENCE function") |
Concrete Worked Examples with Exact Character Counts
Below are three tested examples showing common repetition formulas, their raw spreadsheet outputs, and their exact character metrics:
Example 1: Hardcoded Text with Separator
Count: 5 copies | Length: 75 charactersRepeating a reminder banner with a trailing space and hyphen directly in a formula:
Math: 15 characters per unit ("Confidential - ") × 5 repetitions = 75 characters total. Notice the trailing hyphen and space at the very end.
Example 2: Continuous Text without Separator
Count: 3 copies | Length: 15 charactersRepeating a label without any space for pattern masking or continuous string creation:
Math: 5 characters ("Draft") × 3 repetitions = 15 characters total.
Example 3: Dynamic Cell References (Text in A2, Repetition Count in B2)
Input: A2 = "Approved", B2 = 4 | Length: 36 charactersInstead of hardcoding values, link your formula dynamically to input cells:
Math: 9 characters ("Approved ") × 4 repetitions = 36 characters total.
Eliminating Trailing Separators (The N − 1 Formula)
A common pitfall with formulas like =REPT(A2 & ", ", B2) is that every single copy appends the comma and space, leaving an unwanted separator hanging off the end of your text. In CSV exports, strict SQL insertions, or string comparison tests, that trailing separator can cause downstream errors.
The standard formula pattern to eliminate trailing characters is to repeat the string with its separator B2 − 1 times, then append one final copy of the string without any separator:
Worked Example:
output and length checked in code; not run in Excel or Google SheetsIf A2 contains "SKU-99" and B2 equals 4:
Exact character count: 30 characters(4 copies of 6-character "SKU-99" = 24 chars, plus 3 separators of 2 characters ", " = 6 chars. 24 + 6 = 30). Zero trailing comma.
Repeating Text on New Lines Inside a Single Cell (CHAR(10))
If you need your repeated entries stacked vertically within one cell rather than spreading horizontally across a line, use the ASCII Line Feed character represented by CHAR(10).
Worked Example:
output and length checked in code; not run in Excel or Google SheetsWith A2 = "Item Alpha" and B2 = 3:
Character count breakdown: 10 chars per string × 3 = 30 characters + 2 newline characters = 32 characters total.
Turn on Wrap Text so line breaks are visible in the cell.
Repeating Down Rows vs. Inside a Single Cell
The REPT formula always consolidates output inside a single cell. However, if your destination is a database upload, an accounting ledger, or a lookup table, you almost certainly need each repeated instance occupying its own independent spreadsheet row.
Method A: Traditional Drag-Down Formula
Place your master text in cell A2. In cell B2, write an absolute reference and drag the fill handle down:
To number each row automatically starting from 1 (accounting for a header on row 1):
Method B: Modern Dynamic Array Spilling
output and length checked in code; not run in Excel or Google SheetsIn modern spreadsheet versions, one formula entered in a single cell can automatically "spill" down the exact number of rows specified in B2 without dragging:
Joining Repeated Cells Across Ranges (TEXTJOIN)
If you have a column of repeated records that you want to re-combine into a single delimited sentence or list, do not write tedious manual concatenations like =A2 & ", " & A3 & .... Both Excel (2019, 2021, and Microsoft 365) and Google Sheets support the modern TEXTJOIN function:
Example: Joining Column A2:A6 with a Vertical Pipe
output and length checked in code; not run in Excel or Google SheetsSetting the second parameter to TRUE ensures that any empty or blank rows in your source range are automatically ignored, preventing consecutive double delimiters like " | | ".
Single-Cell Character Limits: Official Specifications
Spreadsheets are calculation engines, not large-scale text buffers. Both Excel and Google Sheets impose hard limits on how many characters a single cell can contain:
Microsoft Excel
32,767 characters- Official Cell Limit: 32,767 characters maximum length of cell contents (text). (Formula string length itself is limited to 8,192 characters).
- Display Limit: While up to 32,767 characters are stored, only 1,024 characters display on the worksheet canvas without cell wrapping.
- What Microsoft Documents on Exceeding Limit: Microsoft states that
REPTreturns#VALUE!when its resulting text would exceed 32,767 characters.
Google Sheets
50,000 characters- Official Cell Limit: Google documents a 50,000-character limit per cell.
- Workbook Capacity: 10 million total cells per entire spreadsheet.
Converting Formulas to Static Text (Paste Special Values)
Formulas are live calculations. If you delete your source cell A2, sort your sheet, or export to CSV, formulas that rely on relative references can break or return #REF! errors. Once your repeated text is generated, freeze it into static plain text:
In Microsoft Excel:
- Select your cell(s) and press Ctrl + C (Cmd + C on Mac).
- Press Ctrl + Alt + V to open Paste Special.
- Press V (Values) and hit Enter.
In Google Sheets:
- Select the cell(s) and press Ctrl + C (Cmd + C on Mac).
- Press Ctrl + Shift + V (Cmd + Shift + V on Mac).
- Your live formula is immediately converted into raw text.
When an Online Text Repeater Is Better Than Spreadsheets
Spreadsheet formulas are indispensable when text must react dynamically to changing figures, link across worksheets, or produce structured CSV columns. But they are often the wrong tool for quick, high-volume repetition:
No 32k/50k Hard Ceiling
Duplicating long text blocks thousands of times can exceed single-cell spreadsheet limits. A browser utility duplicates text up to 10,000 times outside cell constraints.
Zero Syntax Overhead
No need to remember CHAR(10) codes, handle N - 1 trailing separators, or manually enable Wrap Text on cells.
Instant Copy & Download
One click copies directly to your clipboard or downloads a formatted .txt file ready to paste into messaging apps, code editors, or QA test harnesses.
Troubleshooting Common Formula Errors
| Symptom / Error | Underlying Cause | Immediate Fix |
|---|---|---|
| #VALUE! | Negative repetition count or total output exceeds 32,767 characters in Excel. | Ensure count is ≥ 0 and verify that text length × count remains below 32,767. |
| #SPILL! (Excel only) | Cells directly beneath your dynamic array formula in Excel 365 contain existing text or data. | Clear all content from the rows directly below the formula cell. |
| All on one line | CHAR(10) is present, but cell Wrap Text formatting is turned off. | Enable Wrap Text in the Home ribbon (Excel) or Format > Wrapping (Sheets). |
| Formula shows as text | Cell was pre-formatted as "Text" before typing the = sign. | Change cell format to General or Automatic, click into formula bar, and press Enter. |
| Trailing comma / space | Simple =REPT(text & sep, count) appends separator to the final copy. | Switch to the =REPT(text & sep, count - 1) & text structure. |
Comparison Matrix: Excel vs. Google Sheets vs. Online Repeater
| Feature | Microsoft Excel | Google Sheets | My Text Repeater |
|---|---|---|---|
| Core Repeater Function | =REPT(text, count) | =REPT(text, count) | Visual browser tool |
| Single-Cell Capacity | 32,767 characters max | 50,000 characters max | Up to 10,000 repetitions |
| Multiline Separator | CHAR(10) + Wrap Text | CHAR(10) + Wrap Text | Line Break separator preset |
| Row Spilling Support | =IF(SEQUENCE(n), text) | =MAP(SEQUENCE(n), LAMBDA) | Export as raw multiline text |
| Best For | Financial models & desktop sheets | Collaborative cloud workbooks | Quick copying, QA tests & chats |
Frequently Asked Questions
How do I repeat text in Excel using a formula?
Use =REPT("Your Text ", 10). Replace "Your Text " with your desired phrase or a cell reference like A2, and replace 10 with the number of times you want it repeated.
Why does my REPT formula in Excel return #VALUE!?
The #VALUE! error occurs if the count argument is negative (e.g. -1), or if the resulting repeated text exceeds Excel's hard single-cell limit of 32,767 characters.
How do I repeat text with a line break in Google Sheets?
Use =REPT(A2 & CHAR(10), B2 - 1) & A2, then select the cell and go to Format > Wrapping > Wrap. Turn on Wrap Text so line breaks are visible.
How do I repeat text down separate rows instead of in one cell?
In Excel 365, enter =IF(SEQUENCE(B2), A2) to spill text down B2 rows, or use =MAP(SEQUENCE(B2), LAMBDA(n, A2)) in Google Sheets. You can also enter =$A$2 and drag the fill handle down.
What is the maximum number of times REPT can repeat text?
The limit depends on single-cell character capacity: 32,767 characters in Microsoft Excel and 50,000 characters in Google Sheets. Formulas that generate more characters than the host cell allows will fail.
How do I remove the trailing comma from a repeated string in Excel?
Use the N − 1 structure: =IF(B2 > 0, REPT(A2 & ", ", B2 - 1) & A2, ""). This repeats the text with a comma for all except the final repetition, leaving the last entry clean.
Need quick repeated text without formulas?
Generate up to 10,000 copies with custom spaces, newlines, or commas in your browser.