Google Sheets
REPT function in Google Sheets
Returns specified text repeated a number of times.
=REPT(text_to_repeat, number_of_repetitions)REPT syntax and parameters
Two arguments, two required.
- text_to_repeatstringRequired
The character or string to repeat.
- number_of_repetitionsnumberRequired
The number of times text_to_repeat should appear in the value returned. The number_of_repetitions can’t exceed the character limit of a cell, 32,000 characters. If number_of_repetitions is greater than 32,000 characters, REPT will return a #VALUE! error.
REPT examples
Formulas you'll actually reuse.
A star rating drawn from a 1–5 score:
=REPT("★", B2)Result
"★★★★"Zero-pad an ID to six digits:
=REPT("0", 6 - LEN(A2)) & A2Result
"010422"
REPT in Excel
Same name — your formula ports as-is.
Try REPT in the playground
Edit the example — nothing to install.
Preloaded with the REPT formula from Example 1 — change anything and watch it respond.
Loading the editor…
Related functions
More ways Google Sheets gets this done.
- ARABICComputes the value of a Roman numeral.TextExcel
- CHARConvert a number into a character according to the current Unicode table.TextExcel
- CLEANReturns the text with the non-printable ASCII characters removed.TextExcel
- CODEReturns the numeric Unicode map value of the first character in the string provided.TextExcel
- CONCATENATEAppends strings to one another.TextExcel
- DOLLARFormats a number into the locale-specific currency format.TextExcel