Stars
| A | |
|---|---|
| 1 | Rating |
| 2 | 4 |
Formula: C2: =REPT("*",A2)
Result: ****
Four stars for a rating of 4.
REPT with worked examples you can test in the live grid. The argument details are in the Excel guide.
The arguments and common errors are covered in the REPT Excel guide; check the function help in Google Sheets for its own argument list.
| A | |
|---|---|
| 1 | Rating |
| 2 | 4 |
Formula: C2: =REPT("*",A2)
Result: ****
Four stars for a rating of 4.
| A | |
|---|---|
| 1 | Number |
| 2 | 42 |
Formula: C2: =REPT("0",5-LEN(A2))&A2
Result: 00042
Five minus the two digits of 42 gives three zeros to put in front.
| A | |
|---|---|
| 1 | Sales |
| 2 | 7 |
Formula: C2: =REPT("|",A2)
Result: |||||||
The cell shows a bar as long as the value, a simple chart without a chart object.
A tiny spreadsheet with example data. Edit the formula or any number and see the result.
Formula in D2: =REPT("★",5)
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Text | Other | Result | |
| 2 | Alice Johnson | alice johnson | ★★★★★ | |
| 3 | [email protected] | [email protected] | ||
| 4 | extra spaces | |||
| 5 | SKU-2026-0415 | |||
| 6 | iced coffee, tea, sugar | |||
| 7 | Order 417 shipped |
Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.
Enter — commit · F2 — edit · F4 — $ in a reference · Ctrl+C/Ctrl+V — copy and paste · Ctrl+Z — undo
Esc or F6 — leave the sheet for the «Check» button · Shift+Tab in the first cell — back to the page