GuidesAugust 19, 20268 min read

How to Repeat Text in Google Sheets and Excel

Written by My Text Repeater Team
All Posts

Both Google Sheets and Excel use the same REPT function to repeat text inside a cell: =REPT("Hello ", 100). From there, the details that actually matter are spreadsheet-specific — cell references, fill-down behavior, row numbering, text wrapping for line breaks, and the difference between one giant cell and one repeated value per row.

Google Sheets REPT Formula

The core formula:

=REPT("Hello ", 100)

This repeats "Hello " (note the trailing space inside the quotes) 100 times inside a single cell, producing one long combined string — not 100 separate cells.

Excel REPT Formula

Excel uses the identical function, since REPT is a standard spreadsheet function shared across both platforms:

=REPT("Hello ", 100)

Same syntax, same behavior — one cell, one combined string, repeated the number of times specified.

Repeat Text Using a Cell Reference

Hardcoding the text directly into the formula works, but referencing a cell instead makes the formula reusable:

=REPT(A1&" ", 100)

Here, A1 holds the actual text you want repeated. Change the value in A1, and the formula updates automatically — no need to rewrite the formula itself every time.

Use a Separate Cell for the Repetition Count

Instead of hardcoding the number 100 into the formula, you can store it in its own cell and reference that instead:

=REPT(A1&" ", B1)

With this setup, A1 holds the text and B1 holds the repetition count. Changing either value updates the output without touching the formula at all — useful if you're testing different counts and don't want to edit the formula each time.

Repeat Text With Spaces

Adding a space inside the repeated unit is what keeps the output from running together into one unbroken block:

=REPT(A1&" ", 100)

The &" " appends a space after every copy of A1's content, so the result reads as separate words rather than one long string with no breaks.

Repeat Text With Commas or Custom Separators

Swap the space for whatever separator you actually want:

=REPT(A1&",", 100)

This produces a comma after every repetition instead of a space. Any character can go inside the quotes — a semicolon, a pipe, a dash — depending on what format you need.

Repeat Text With Line Breaks and Text Wrapping

To put each repetition on its own line inside a single cell, use CHAR(10) as the line-break character:

=REPT(A1&CHAR(10), 99)&A1

This formula repeats A1 followed by a line break 99 times, then appends one final copy of A1 without a trailing break — giving you exactly 100 total repetitions, each on its own line, with no empty line left dangling at the end.

Line breaks inside a cell won't display correctly unless text wrapping is turned on for that cell. In both Google Sheets and Excel, this is done through the cell formatting options — without it, the line breaks are technically present in the data but the cell will just show one squashed-together line.

Create One Repeated Value Per Row

If you want each repetition in its own row instead of packed into a single cell, REPT alone won't do it — that function always produces one combined cell. Instead, put the value once in the first cell, then fill the formula (or the value itself) down through the number of rows you need:

=A1

Placed in A2 and filled down, this simply repeats the value from A1 in every row below it. This is the better approach when the destination — a database import, a bulk test upload, another spreadsheet — expects one entry per row rather than one long string.

Create Numbered Repeated Rows

To number each repeated row alongside the value, combine the row number with the repeated text:

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

ROW() returns the current row number, and $A$1 is an absolute reference — the dollar signs lock it in place so it doesn't shift when you fill the formula down through other rows.

One detail worth catching: if your data starts on row 2 instead of row 1 (common when row 1 holds a header), the numbering will start at "2." instead of "1." unless you adjust for it — for example, =(ROW()-1)&". "&$A$1 if your first data row is row 2 and you want numbering to start at 1.

Repeat a Phrase as One Complete Unit

If the text you're repeating is a multi-word phrase — "yes no," for example — referencing the whole cell keeps the phrase intact as a single unit rather than splitting it apart:

=REPT(A1&" ", 10)

As long as A1 contains "yes no" as one entry, the formula repeats that full phrase 10 times, keeping both words together on every repetition rather than treating them as separate items.

Generate Controlled Spreadsheet Test Data

Spreadsheets are a common place to build small test datasets — repeated placeholder values used to check how an import, formula, or downstream process handles a specific pattern of data.

=REPT("test-value ", 50)

Combined with the one-repetition-per-row approach above, this is a fast way to generate a controlled block of identical test rows without typing each one manually.

One Giant Cell vs. One Repetition Per Row

These two approaches solve different problems, and it's worth being clear about which one you actually need:

  • One giant cell (via REPT) makes sense when you need a single combined string — for pasting somewhere else as one block, or for a character-count test where the whole thing needs to exist as one piece of text.
  • One repetition per row makes sense when the destination expects structured, row-by-row data — a database import, a list of test entries, or anything that needs to be treated as separate records rather than one long string.

Picking the wrong one usually isn't obvious until you try to use the output somewhere and it doesn't fit the shape that destination expects.

Handle Empty Source Cells

If the referenced cell is empty, REPT doesn't throw an error — it just returns an empty result, since it's repeating nothing. This can be easy to miss, especially in a filled-down formula where one row's source cell was accidentally left blank. Worth a quick scan down the column before trusting the output.

Avoid Trailing Separators and Unwanted Spaces

A formula like =REPT(A1&" ", 100) adds a space after every repetition — including the very last one, leaving a trailing space at the end of the output that's easy to miss. Depending on where the result is headed, that trailing character can cause exact-match comparisons to fail, since "Hello " (with a trailing space) isn't the same string as "Hello" without one.

The line-break formula shown earlier handles this by appending one final copy without a trailing separator:

=REPT(A1&CHAR(10), 99)&A1

For a space or comma separator, the same technique applies — repeat the pattern one fewer time than your target count, then append one final unseparated copy at the end.

Check Whether the Output Contains Exactly the Intended Number of Copies

It's worth confirming a formula actually produced the count you meant, especially with off-by-one issues around trailing separators. LEN() combined with SUBSTITUTE() can help here — for example, comparing the total character length before and after removing the repeated text gives a rough way to verify the count. For most everyday use, though, a quick visual scan of the cell content (with wrapping enabled) is usually enough to catch an obvious miscount.

Spreadsheet Output and Display Limitations

A few spreadsheet-specific limits are worth knowing before relying on REPT for a large output:

  • Excel cells cap out at 32,767 characters. A large repetition count combined with a long source string can hit that ceiling.
  • Very long cell content is hard to review visually, even with wrapping enabled, since scrolling through thousands of characters inside one cell isn't practical.
  • Formulas recalculate. If the source cell changes, the output changes with it — which is useful for reusability, but means the formula-based result isn't a fixed, static piece of text unless you convert it.

Common Google Sheets and Excel Formula Mistakes

  • Forgetting the separator character inside the REPT formula, resulting in one unbroken block instead of the intended spacing.
  • Using a relative reference instead of an absolute one (A1 instead of $A$1) when filling a formula down, causing the reference to shift row by row instead of staying fixed.
  • Filling a formula down too far, creating extra unwanted rows beyond the intended count.
  • Not enabling text wrapping, so line breaks exist in the data but aren't visible in the cell.
  • Leaving a trailing separator at the end of the output without accounting for it.
  • Pasting a formula-driven result somewhere that needs static text, without converting the formula to a value first (copy, then Paste Special > Values Only) — otherwise the pasted content can break if it's referencing cells that don't exist in the new location.

When an Online Text Repeater Is Faster Than a Spreadsheet

Formulas are the right call when the repeated text needs to live inside a spreadsheet, react to changing cell values, or become part of a larger sheet of calculations. For a quick, one-off piece of repeated text that doesn't need to exist inside a spreadsheet at all, opening a spreadsheet just to write a formula is often more setup than the task needs. An online text repeater skips the formula entirely — type the text, set the count and separator, and copy or download the result directly.

Comparison: Spreadsheet Formulas vs. Other Methods

MethodBest forOutputAdvantageLimitation
Google Sheets REPTRepeated text inside a sheetOne combined cellReactive to cell changes, integrates with other formulasCharacter limits, no native row-splitting
Excel REPTSame, in ExcelOne combined cellSame formula syntax as Sheets32,767-character cell limit
One-copy-per-row formulaStructured, row-based test dataSeparate rowsMatches import/database formatsRequires filling down carefully to avoid extra rows
Online Text RepeaterQuick, standalone repeated textCopyable or downloadable textNo spreadsheet needed, instant setupNot connected to live cell data

Frequently Asked Questions

How do I repeat text in Google Sheets?

Use the REPT function: =REPT("Hello ", 100) repeats "Hello " 100 times inside a single cell. Reference a cell instead of typing the text directly if you want the formula to update automatically when the source value changes.

How do I repeat text in Excel?

Excel uses the same REPT formula as Google Sheets: =REPT("Hello ", 100). The syntax and behavior are identical across both platforms.

How do I repeat text based on a number stored in another cell?

Reference the count cell directly in the formula: =REPT(A1&" ", B1), where A1 holds the text and B1 holds the repetition count.

How do I put each repeated value on its own row instead of one cell?

REPT always produces a single combined cell. For one value per row, place the text in the first cell and fill it (or a formula referencing it) down through the number of rows you need.

How do I number each repeated row?

Combine ROW() with an absolute cell reference: =ROW()&". "&$A$1. Adjust the formula if your data doesn't start on row 1, since ROW() returns the actual spreadsheet row number.

Why does my repeated text show up as one long line instead of separate lines?

Line breaks created with CHAR(10) inside a cell only display correctly once text wrapping is turned on for that cell — otherwise the breaks exist in the data but aren't visible.

Why does my repeated output have an extra space or line at the end?

A formula like =REPT(A1&" ", 100) adds a separator after every copy, including the last one, leaving a trailing space. Structuring the formula to repeat one fewer time and append a final unseparated copy avoids this.

When should I use a spreadsheet formula instead of an online text repeater?

Use a formula when the repeated text needs to live inside a spreadsheet and stay connected to changing cell values. For a one-off piece of repeated text that doesn't need to exist in a sheet at all, an online text repeater is usually faster.

When to Use Which

A spreadsheet formula earns its place when the repeated text is part of a larger sheet — reacting to other cells, feeding into further calculations, or needing to live alongside real spreadsheet data. For everything else — a quick block of repeated text you just need to copy somewhere — opening a formula-based tool is more setup than the task calls for, and a standalone text repeater gets you the same result faster.

If the reason you're generating repeated text in the first place is controlled test strings for QA work, it's worth deciding upfront whether the test actually needs the data inside a spreadsheet or just needs the raw string — that answer usually points you to the right method immediately.

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

More Guides & Articles

Guides

How to Repeat Text for Testing and QA: Generate Reliable Test Data

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