REPT function

REPT repeats a text string a specified number of times, returning the concatenated result as a single text value, useful for visual bars or padding.

=REPT(text, number_times)

Generate a REPT formula

Describe what you need. The generator will reach for REPT where REPT is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives β€” "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How REPT reads its arguments
textrequirednumber_timesrequiredREPT β†’
ArgumentRequiredDescription
textRequiredThe text (or any value that can be coerced to text) to repeat; if an error value is supplied the function returns that error.
number_timesRequiredA non-negative number indicating how many times to repeat text; negative or non-numeric inputs cause a #VALUE! error, and fractions are truncated.

Returns

It returns a single text string in the calling cell.

Availability

Excel: All Β· Google Sheets: Supported

Worked examples

1. Create a visual CSAT bar

Ticket IDPriorityOpenedClosedAgentCSAT
T123High2023-08-012023-08-02Alice5
=REPT("β˜…", F2)

Result: β˜…β˜…β˜…β˜…β˜…

The formula looks at the CSAT score in column F (value 5) and repeats the star character five times. REPT concatenates the stars into a single string, producing a quick visual bar that can be placed next to the numeric rating.

2. Pad ticket IDs to eight characters

Ticket IDPriorityOpenedClosedAgentCSAT
T9Low2023-08-032023-08-04Bob3
=REPT("0", 8-LEN(A2)) & A2

Result: 000000T9

LEN(A2) returns the length of the ticket ID (2 characters). Subtracting from 8 gives the number of zeros needed (6). REPT creates six zeros, which are then concatenated with the original ID, yielding a uniformly-length identifier.

3. Repeat priority label for emphasis

Ticket IDPriorityOpenedClosedAgentCSAT
T456Medium2023-08-052023-08-06Carol4
=REPT(B2 & " ", 2)

Result: Medium Medium

Column B contains the priority text. By appending a space and telling REPT to repeat the combined string twice, the result shows the priority label duplicated with a trailing space, useful for creating a bold-looking label in reports.

Common errors

Which REPT error are you seeing?
REPT returned an error#VALUE!
Wrap the count with MAX(0, value) or ensure the source cell never contains a negative number.
#VALUE!
Convert the text to a numeric value with VALUE() or replace the cell content with an actual number.
#VALUE!
Limit the repeat count, or truncate the result afterwards with LEFT(...,32767).
ErrorWhy it happensHow to fix it
#VALUE!The number_times argument is negative; REPT cannot repeat a string a negative number of times.Wrap the count with MAX(0, value) or ensure the source cell never contains a negative number.
#VALUE!Number_times contains text that cannot be coerced to a number, such as "three".Convert the text to a numeric value with VALUE() or replace the cell content with an actual number.
#VALUE!The repeated string would exceed Excel's 32,767-character limit, which REPT enforces as an error.Limit the repeat count, or truncate the result afterwards with LEFT(...,32767).

Tips and when to use something else

  • Use REPT with CHAR(9608) or other block characters to build simple bar charts inside cells.
  • Combine REPT with TEXT to create leading-zero padding for IDs, invoice numbers, or timestamps.
  • When you need a delimiter between many items, TEXTJOIN is more efficient than nesting REPT calls.
  • REPT truncates fractional repeat counts; apply INT() first if you want explicit rounding behavior.

Frequently asked questions

How can I use REPT to create a progress bar that reflects a percentage?
Calculate the number of segments by multiplying the percentage by the total bar length, round to an integer, then use REPT with a solid block character (e.g., CHAR(9608)). Combine it with REPT of a light-shade character for the remainder to display a visual progress indicator.
Why does REPT return #VALUE! when the source cell contains a formula error like #DIV/0!?
REPT propagates any error value it receives as its text argument. If the cell you reference evaluates to an error, REPT cannot process it and returns the same error code. Fix the underlying formula so it produces a valid value before applying REPT.
Can REPT repeat Unicode symbols such as emojis or non-ASCII characters?
Yes. REPT works with any Unicode character that can be represented in a cell, including emojis. The function repeats the exact code points, so =REPT("😊",3) will return three smiley faces as long as the font supports the glyph.
Is there a limit to how many times I can repeat a string with REPT?
The result of REPT cannot exceed 32,767 characters, which is Excel's maximum string length in a cell. If the repeat count would produce a longer string, REPT returns #VALUE!. Plan your repeat count accordingly or truncate the output with LEFT if you need longer visual representations.

Need a different formula?

The full generator is not scoped to one function β€” describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17