Formula Guide

The Excel REPT Function
explained simply

REPT repeats a piece of text a specified number of times — sometimes used to build simple in-cell visualizations.

ExcelPro · 3 min read · Updated June 2026
Contents
  1. What does REPT do?
  2. Syntax
  3. 3 examples
  4. FAQ

What does REPT do?

REPT repeats a given text string a specified number of times and joins the repetitions together with no separator.

A popular creative use is building a simple text-based bar chart directly inside a cell, using a repeated character like █ scaled to a value.

Syntax

=REPT(text, number_times)
ArgumentDescription
text requiredThe text to repeat.
number_times requiredHow many times to repeat it.

Examples

Example 1
Repeat a character
=REPT("-",10)

Returns "----------", a simple divider line.

Example 2
In-cell bar chart
=REPT("█",B2/10)

If B2 is 85, this draws 8.5 (rounded down) block characters — a crude but effective visual bar proportional to the value.

Example 3
Pad a number with leading characters
=REPT("0",5-LEN(A2))&A2

Pads A2 with leading zeros up to 5 digits total — useful for ID codes.

Common mistakes

⚠️ Using a non-integer for number_times

Excel rounds down automatically, so 8.5 repetitions becomes 8 — worth knowing if your bar-chart trick looks slightly off.

FAQ

Is REPT useful for anything beyond visual tricks?
Yes — it is genuinely useful for padding codes, building separators, and generating test data with repeated patterns.

Practise Excel with real data

ExcelPro has 700+ hands-on Excel exercises across 7 career tracks — free to start, no download needed.

Start practicing free →

Related formulas

CONCAT TEXTJOIN LEN