REPT Function
Repeats text a given number of times.
Category
Text
Available in
All versions, Microsoft 365
Returns
Text
Want to practice REPT in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox
Overview
REPT repeats a character or piece of text as many times as you ask.
It's handy for quick in-cell bar charts, padding codes to a fixed length, and visual star ratings.
Syntax
=REPT(text, number_times) Explain
Arguments
| Argument | Required? | What it does |
|---|---|---|
| text | Yes | The text to repeat. |
| number_times | Yes | How many times. Decimals are truncated; 0 returns empty text. |
Examples
Example 1 — An in-cell bar chart
One block for every 100 in sales.
C2fx=REPT("■", ROUND(B2/100, 0))
| A | B | C | |
|---|---|---|---|
| 1 | Region | Sales | Chart |
| 2 | West | 620 | ■■■■■■ |
| 3 | East | 480 | ■■■■■ |
| 4 | North | 250 | ■■■ |
=REPT("■", ROUND(B2/100, 0)) Explain
Common mistakes
- Negative counts. A negative number_times returns #VALUE!. Guard with MAX(0, …).
Notes

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.