SheetsLessons
Text function

REPT function in Google Sheets

REPT repeats text a given number of times. People use it for quick star ratings, simple in-cell bar charts and padding.

Syntax

=REPT(text_to_repeat, number_of_repetitions)
text_to_repeat
The text to repeat.
number_of_repetitions
How many times. Decimals are truncated.

Practice REPT

Task 1 of 1

Show the rating in B2 as stars: repeat "★" that many times. Answer in C2.

C2
fx

Tip: while typing a formula, click a cell or drag across cells to insert references. Press Enter to check, and Tab to accept a function suggestion.

REPT examples

Each example below runs against this sample sheet. The results are calculated by the same engine as the practice grid.

ABCD
1StudentClassScorePassed
2PriyaA92TRUE
3LeoB67FALSE
4ChloeA48FALSE
5MateoB81TRUE
6InesCFALSE
7KaiC75TRUE
Test scores (Ines missed the test)
FormulaResultWhat it shows
=REPT("★", ROUND(C2 / 20, 0))★★★★★Score out of 5 stars.
=REPT("|", C5 / 10)||||||||An in-cell bar chart.
=REPT("ab", 3)abababMulti-character text works too.

Tips and common mistakes

  • A negative count returns #VALUE!.

Related functions