Back to functions
Text2026-06-130 related articles

REPT Function in Excel

Repeat a text string a specified number of times.

Syntax

REPT(text, number_times)

Arguments

text

Required

The text you want Excel to repeat.

number_times

Required

A positive number that tells Excel how many times to repeat the text.

What it returns

Returns a text string made by repeating the original text.

What REPT does

REPT repeats the same text string as many times as you specify. It is useful for padding values, building quick visual bars, or generating repeated separators inside formulas.

Practical examples

Repeat a short pattern several times

=REPT("*-",3)

This returns the pattern three times in one text string.

Build a simple text bar

=REPT("-",10)

This is a quick way to generate divider lines or small text-based indicators.

Common mistakes and notes

The output must stay under Excel's text limit

Microsoft notes that REPT returns #VALUE! if the result would exceed 32,767 characters.

Non-integer repeat counts are truncated

If number_times is not a whole number, Excel truncates it before building the final text.

Related functions

Official documentation