REPT Function
Repeats text a given number of times.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| text | The text string to repeat. | Required |
| number_times | A positive number indicating how many times to repeat text. Fractional values are truncated to integers. | Required |
Basic Example
Repeat a separator
=REPT("*- ",3)The string "*- " is concatenated three times.
Advanced Examples
Example 1: In-cell bar chart
Cell A1 holds a count like 5Visualize with repeated bars
=REPT("|",A1)Example 2: Pad a value with leading zeros
Make a 5-digit code from A1 = 42Pad to a fixed width
=REPT("0",5-LEN(A1)) & A1How REPT Works
REPT concatenates the text argument to itself number_times times. The repeat count is truncated to an integer, and if it is 0 the result is an empty string.
Important Notes & Limitations
The result is limited to 32,767 characters; longer outputs return #VALUE!.
number_times is truncated to an integer and must be non-negative.
Purely cosmetic; the repeated text is not a real chart or formatted number.
Common Errors & Fixes
#VALUE! errorThe repeated result would exceed 32,767 characters, or number_times is negative.Fix: Reduce the repeat count so the total length stays under the limit and keep it non-negative.
Download Practice File
REPT
reptPractice REPT with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the REPT function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps