Text · Nov 16, 2026

The REPT function,
measured & explained.

REPT returns text repeated a given number of times. With one character it builds padding, leader dots and in-cell bar charts; with a longer string it repeats a pattern. The count is truncated to an integer, zero returns empty text, and a negative count raises #VALUE!.

D1
fx
=REPT(…)
0
measured gallery rows
0
sourced errors fixed
0
platforms checked
// 01 — Anatomy

How REPT works

Returns text. The count is truncated toward zero; the result is capped at 32,767 characters.

=REPT(text, number_times)
textThe text string to repeat.
number_timesHow many times; truncated to integer. 0 gives empty, negative gives #VALUE!.
.bool-moat td.res-text{color:var(--cyan);font-weight:700;font-family:var(--mono)}
// 02 — Count behaviour

How the count controls length

Truncation, zero and computed bars, measured live. Click any row to load it.

Count rules, measured

ExpressionResultWhy
=REPT("*",5)*****Five stars
=REPT("ab",3)abababPattern repeated
=REPT("-",10)----------Ten dashes
=REPT("=",B2)======Bar: B2=6
=REPT("|",3)|||Three pipes
=REPT("0",4)0000Zero padding
=REPT(A2,2)AlphaAlphaRepeat a cell value
=REPT("x",0)Zero gives empty
⚠ REPT can overflow the 32,767-character cell limit: REPT("x",40000) returns #VALUE!. Cap the count when building bars from large numbers.
REPT truncates the count toward zero and returns empty text at 0; only a negative count errors (#VALUE!).
// 03 — Try it live

Interactive REPT playground

Edit the table or type any formula — the engine evaluates instantly. Load a preset to build stars, separators and an in-cell bar.

A1Sample data — click any cell to edit, the formula re-evaluates live
Result
—
✓ readyHyperFormula 3.5
// 04 — Error library

The real-world error library

8 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.

// 05 — Cross-platform

Where REPT works

REPT is a core text function present in every Excel version and platform.

PlatformSupportNotesGotcha
✓ Supported full REPT◐ Partial works with caveatsCompiled from public docs · verify against your build
// Go deeper

Master text

REPT is one piece. The full course walks the toolkit end to end with live, measured examples.

  • In-cell bars with REPT("|",value/scale)
  • Count truncated toward zero
  • Zero gives empty, negative errors
  • Cap count under 32,767 chars
Free while in beta
Browse the function library

No account needed. Every page has a live playground.

// 07 — FAQ

Frequently asked