Excel function

REPTfunction

Repeats text a given number of times.

All versions
=REPT("★", 4)

Text1 char

1★

Result4 chars

1★1
2★2
3★3
4★4

Enter 3.9 for number_times. The decimal part is dropped, so it repeats 3 times. Try breaking it on purpose to see the errors.

Result

★★★★

text

The text to repeat.

number_times

How many times to repeat. The decimal part is dropped; 0 gives empty text and a negative number gives #VALUE!.

What is the REPT function?

=REPT(text, number_times)

REPT joins copies of a text a given number of times. It is often used for star ratings (★★★) or simple bar charts inside a cell.

Play the steps on the strip above to see each copy shown in alternating colors.

Arguments

text
The text to repeat.
number_times
How many times to repeat. The decimal part is dropped. 0 gives empty text; a negative number gives #VALUE!.

REPT examples

  1. Example 1. Star rating

    =REPT("★", 4)

    "★★★★".

  2. Example 2. Score bar

    =REPT("|", B2/10)

    If B2 is 75, you get 7 bars (7.5 loses its decimal part).

  3. Example 3. Pad with zeros

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

    If A2 is "42", the result is "00042".

Common mistakes

FAQ

Filled and empty stars together?
Use two REPTs: =REPT("★", A2)&REPT("☆", 5-A2).
A delimiter between copies?
REPT cannot do that. Repeat the text with the delimiter attached and then remove the last one.