Contact

REPT Function in Google Sheets: Examples, Pitfalls & Compatibility

Text Beginner Google Sheets

REPT in Google Sheets: repeat a text unit to build a short display bar, separator or padded label. Includes worked examples and application-specific cautions.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: Use REPT in Google Sheets to repeat a text unit to build a short display bar, separator or padded label. The official REPT reference is the source for the function definition and platform-specific rules described below.

Availability and version history

  • Introduced: Introduction version not established by the official history reviewed.
  • Availability: Documented in the rolling Google Sheets service; examples use the web spreadsheet workflow.
  • Checked: October 14, 2026; official REPT reference. Documentation check, not a new native test; existing example-verification notes retain their scope.

Syntax and arguments

=REPT(text_to_repeat, number_of_repetitions)

text_to_repeat (required): The exact text unit, including any intended separator.

number_of_repetitions (required): How many copies to produce. These controls use positive whole-number counts; validate the requested display size explicitly.

Examples use English function names, comma argument separators and decimal points. Adapt formula separators to your workbook settings, not punctuation inside quoted text.

When to use it

Use REPT for a compact visual cue or controlled text padding. Keep the original numeric value visible as well: a bar is a presentation aid, not a replacement for the data. Long repeated strings make worksheets difficult to use.

Three worked examples

Each example is independent. Where input cells are listed, enter those values first; otherwise the formula is self-contained. Expected outputs are independently checked calculations or documented error expectations, not captured results from Google Sheets.

Example 1: Make a three-unit indicator

=REPT("#",3)

Expected result: "###" (quoted here to make spaces and text boundaries visible).

Each hash sign represents one display unit according to the scale you define.

Example 2: Repeat a spaced label

=REPT("go ",2)

Expected result: "go go " (quoted here to make spaces and text boundaries visible).

Spaces only appear because the repeated text includes one.

Example 3: Check the length of a repeated pattern

=LEN(REPT("ab",4))

Expected result: 8.

Four copies of a two-character unit produce eight characters. This checks the display length independently of the visible pattern.

Check spaces and text length explicitly

=REPT("go",2)
=REPT("go ",2)
=LEN(REPT("go ",2))

Expected results are “gogo”, “go go “, and 6. Quotes show the text boundaries; they are not returned characters. The last string has two letters and one space per copy.

Google explicitly says REPT inserts no separators. Applying =TRIM(REPT("go ",2)) gives expected text “go go” with length 5, because the final ordinary space is removed.

Advanced example: a short, capped display bar

For positive whole-unit quantities 1,3,5,8 in A2:A5, use:

=REPT("#",MIN(A2,5))

Filled down, the expected bars contain 1,3,5,5 hashes. Keep the original quantity beside each bar: 5 and 8 intentionally share the capped display, so the bar is not a lossless encoding.

If a display count is calculated from another unit, document that conversion before REPT. These controls avoid zero and fractional counts rather than importing another spreadsheet’s truncation policy.

Advanced example: pad short text identifiers

Enter text 7,42,381 in C2:C4. For each of these known short ASCII strings:

=REPT("0",5-LEN(C2))&C2

Expected padded text is 00007, 00042, and 00381. The repeat counts are 4,3,2, and each final identifier contains five characters.

This specific formula assumes the source length is below five. Do not apply it unchecked to arbitrary long inputs, because the count can become zero or negative. If a source is already a numeric cell, decide explicitly how it becomes text before treating it as an identifier.

Distinguish repetition from multiplication

Repeating text “12” three times produces “121212”, whose length is 6. It is not the numeric product 12×3=36.

Use REPT for display or string construction, and ordinary arithmetic for quantities. These small positive-count examples demonstrate exact text composition; they are not maximum-size, memory or rendering benchmarks.

Put it to work safely

Set a documented display scale and maximum count before generating bars. A count of five should mean the same thing throughout the column. Include a separator inside the repeated text when needed; REPT does not add spaces for you. Avoid hiding materially different quantities behind the same clipped bar without also displaying the actual values.

Common mistakes and fixes

Repeated words run together. The text unit is repeated exactly. Add a space inside the quoted text when separation is required.

An empty-looking result is overinterpreted. The dedicated reference does not explicitly specify zero, negative or fractional-count behavior. These worked controls use positive whole numbers; an empty-looking result alone does not establish a physically empty cell.

A large count fails or makes the sheet unwieldy. Validate counts and keep display strings short. The application-specific length rules should not be assumed identical.

Google Sheets-specific notes

Google names a 32,000-character limit and #VALUE! beyond it, but describes this partly as a repetition-count limit and partly as cell capacity. The one-character control REPT(“x”,32001) is an expected error under that stated rule, not a native boundary test. The wording does not establish a complete multi-character or general Sheets cell-capacity limit here. This guide uses short integer counts and makes no claim that Excel and Sheets have identical maximum string lengths. See the vendor reference for the current definition.

Excel and Google Sheets comparison

Small, positive whole-number examples are suitable comparison cases. Result-length ceilings and fractional or invalid counts must be checked separately when exporting a workbook.

Compare the REPT guide for Microsoft Excel and its official documentation. Having a guide in both libraries establishes two documented references, not a certificate of identical behavior across releases, locales or file conversions.

Evidence and testing scope

Editorial verification: Complete manuscript and dedicated Google reference reviewed October 14, 2026; original controls and added positive-integer string models checked. The three worked cases are included in this release’s reproducible Python checking suite. It checks the stated arithmetic, calendar or text model and the expected documented error classification; it is not the Google Sheets calculation engine. No native application run, UI screenshot, maximum-size benchmark or cross-version certification is claimed. Review the editorial testing standards before relying on a formula in a critical workbook.