FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

REPT in Google Sheets

REPT with worked examples you can test in the live grid. The argument details are in the Excel guide.

In Google Sheets

The arguments and common errors are covered in the REPT Excel guide; check the function help in Google Sheets for its own argument list.

Worked examples in Google Sheets

Stars

A
1Rating
24

Formula: C2: =REPT("*",A2)

Result: ****

Four stars for a rating of 4.

Leading zeros

A
1Number
242

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

Result: 00042

Five minus the two digits of 42 gives three zeros to put in front.

Text bar

A
1Sales
27

Formula: C2: =REPT("|",A2)

Result: |||||||

The cell shows a bar as long as the value, a simple chart without a chart object.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in D2: =REPT("★",5)

Example spreadsheet for REPT
ABCD
1TextOtherResult
2Alice Johnsonalice johnson★★★★★
3[email protected][email protected]
4 extra spaces
5SKU-2026-0415
6iced coffee, tea, sugar
7Order 417 shipped
Result in D2: ★★★★★

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.