REPT Function in Excel, Google Sheets, Airtable & Notion
REPT repeats a piece of text a given number of times. REPT("★", 4) is “★★★★”.
Syntax in each app
| App | Support | Syntax & notes |
|---|---|---|
| Excel | ✔ Built in | REPT(text, number_times) |
| Google Sheets | ✔ Built in | REPT(text_to_repeat, number_of_repetitions) |
| Airtable | ✔ Built in | REPT(string, number) |
| Notion | ✔ Built in | repeat(text, times)For padding, Notion also has padStart(text, length, pad) and padEnd(). |
| Excel | =REPT("★", 4) | open excel.new ↗ |
|---|---|---|
| Google Sheets | =REPT("★", 4) | open sheets.new ↗ |
| Airtable | REPT("★", 4) | |
| Notion | repeat("★", 4) |
Excel & Sheets use cell ranges. Paste this sample data into cell A1 of a blank sheet, then paste the formula into any empty cell.
Arguments
| Argument | What it means |
|---|---|
text | The text to repeat. |
number_times | How many times. Decimals are truncated; 0 gives empty text; negative is #VALUE!. |
Examples
| Formula | Result | Why | Copy |
|---|---|---|---|
=REPT("★", 4) | ★★★★ | ||
=REPT("★", B2)&REPT("☆", 5-B2) | ★★★☆☆ | A 5-star rating with 3 in B2. | |
=REPT("|", B2/10) | In-cell bar | A quick bar chart; decimals are truncated. | |
=REPT("0", 6-LEN(A2))&A2 | 000042 | Pad 42 in A2 to six digits. TEXT(A2, "000000") also works. |
Examples use Excel / Google Sheets syntax unless noted.
How REPT works
REPT is mostly used for visual tricks: in-cell bar charts (=REPT("█", B2/MAX(B$2:B$20)*20)), star ratings, progress bars and dotted leaders. It is also a simple way to pad codes to a fixed width: =REPT("0", 6-LEN(A2))&A2 turns 42 into “000042”.
The repeat count is truncated, not rounded, so 3.9 repeats three times. A negative count returns #VALUE!, which happens easily in padding formulas when the value is already longer than the target. Guard with MAX(0, …). Results longer than 32,767 characters also fail.
Airtable's REPT and Notion's repeat() behave the same. Notion's progress bars are often built with repeat("●", round(prop("Progress") * 10)). For padding, Notion's padStart(text, 6, "0") is simpler than REPT.
Frequently Asked Questions
- How do I make a bar chart inside a cell?
- Repeat a block character in proportion to the value:
=REPT("█", ROUND(B2/MAX(B$2:B$20)*20, 0)), then use a monospaced font.