GuidesAugust 19, 20268 min read

How to Repeat Text in Excel and Google Sheets

Written by David Miller
All Posts
Quick Answer

To repeat text inside a single cell in Excel or Google Sheets, use the built-in REPT function:

=REPT("Text to repeat ", 10)

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:

=REPT(text, number_times)

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 ScenarioFormula ExampleExcel 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 characters

Repeating a reminder banner with a trailing space and hyphen directly in a formula:

=REPT("Confidential - ", 5)
Confidential - Confidential - Confidential - Confidential - Confidential -

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 characters

Repeating a label without any space for pattern masking or continuous string creation:

=REPT("Draft", 3)
DraftDraftDraft

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 characters

Instead of hardcoding values, link your formula dynamically to input cells:

=REPT(A2 & " ", B2)
Approved Approved Approved Approved

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:

=IF(B2 > 0, REPT(A2 & ", ", B2 - 1) & A2, "")

Worked Example:

output and length checked in code; not run in Excel or Google Sheets

If A2 contains "SKU-99" and B2 equals 4:

SKU-99, SKU-99, SKU-99, SKU-99

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).

=IF(B2 > 0, REPT(A2 & CHAR(10), B2 - 1) & A2, "")

Worked Example:

output and length checked in code; not run in Excel or Google Sheets

With A2 = "Item Alpha" and B2 = 3:

Item Alpha Item Alpha Item Alpha

Character count breakdown: 10 chars per string × 3 = 30 characters + 2 newline characters = 32 characters total.

Essential Requirement: Turn on "Wrap Text"

Turn on Wrap Text so line breaks are visible in the cell.

In Microsoft Excel:Select the cell → Navigate to the Home tab → Click Wrap Text in the Alignment section (or press Alt + H + W on Windows).
In Google Sheets:Select the cell → Click Format in the menu → Wrapping → Select Wrap (or click the Wrap icon in the toolbar).

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:

=$A$2

To number each row automatically starting from 1 (accounting for a header on row 1):

=(ROW() - 1) & ". " & $A$2

Method B: Modern Dynamic Array Spilling

output and length checked in code; not run in Excel or Google Sheets

In modern spreadsheet versions, one formula entered in a single cell can automatically "spill" down the exact number of rows specified in B2 without dragging:

In Excel 365 & Excel 2021:
=IF(SEQUENCE(B2), A2)
In Google Sheets:
=MAP(SEQUENCE(B2), LAMBDA(n, A2))

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:

=TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)

Example: Joining Column A2:A6 with a Vertical Pipe

output and length checked in code; not run in Excel or Google Sheets
=TEXTJOIN(" | ", TRUE, A2:A6)

Setting 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 REPT returns #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:

  1. Select your cell(s) and press Ctrl + C (Cmd + C on Mac).
  2. Press Ctrl + Alt + V to open Paste Special.
  3. Press V (Values) and hit Enter.

In Google Sheets:

  1. Select the cell(s) and press Ctrl + C (Cmd + C on Mac).
  2. Press Ctrl + Shift + V (Cmd + Shift + V on Mac).
  3. 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 / ErrorUnderlying CauseImmediate 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 lineCHAR(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 textCell 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 / spaceSimple =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

FeatureMicrosoft ExcelGoogle SheetsMy Text Repeater
Core Repeater Function=REPT(text, count)=REPT(text, count)Visual browser tool
Single-Cell Capacity32,767 characters max50,000 characters maxUp to 10,000 repetitions
Multiline SeparatorCHAR(10) + Wrap TextCHAR(10) + Wrap TextLine Break separator preset
Row Spilling Support=IF(SEQUENCE(n), text)=MAP(SEQUENCE(n), LAMBDA)Export as raw multiline text
Best ForFinancial models & desktop sheetsCollaborative cloud workbooksQuick 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.

Open Text Repeater
Tags:#Google Sheets#Excel#REPT Formula#Spreadsheets#Text Repeater#Tutorials

More Guides & Articles

Guides

How to Repeat Text for Testing and QA: Test Data Guide

Learn how to generate repeated, deterministic test strings for QA — character-limit testing, Unicode handling, multiline fields, and structured data.

Read More
Guides

How to Repeat Text on New Lines Online

Learn how to repeat text on separate lines online — words, sentences, paragraphs, and test values, each formatted with a clean line break between copies.

Read More
Guides

How to Repeat a Word or Sentence Multiple Times Online

Learn how to repeat a word, phrase, sentence, or paragraph multiple times online — including when to use a word repeater vs. a full text repeater.

Read More