Function · Text

Excel REPT function

The Excel REPT function repeats text. Four asterisks are REPT("*", 4). A count of 0 returns an empty string, and a negative count is #VALUE!.

All current Excel versions. Also in Excel for the web and Google Sheets.

Syntax =REPT(text, number_times)

REPT
=REPT("*",4)

Arguments

NameRequiredWhat to pass
textRequiredThe text to repeat.
number_timesRequiredHow many times. A fraction is cut down to the integer. 0 returns empty text. A negative number is #VALUE!.

Examples

Four asterisks

=REPT("*",4)

Result ****

=REPT(B1,B2)B3
Repeat
AB
1Text*
2Times4
3Result****
A picture of the sheet, not a live calculator. REPT("*", 4.9) is still four asterisks.

REPT repeats a piece of text. * four times is ****. A count of 0 is an empty string, which is useful when you want a marker only if a count is positive. A fraction is cut toward zero first, so 4.9 still means four copies.

The result is text, and it cannot exceed 32,767 characters. People use REPT to pad a code with zeros on the left, =REPT("0",5-LEN(A1))&A1, when the code must stay text. A number format can show leading zeros too, and it does not change the value into text. Use REPT when the padded result has to be text.