How to Repeat Text and Create In-Cell Charts Using the REPT Function in Excel

When you are building a dashboard in Microsoft Excel, you sometimes need to visually represent data without building complex, heavy graphical charts. For example, if you want to generate a simple “star rating” system (e.g., 5 stars) next to a product, or create a quick in-cell bar graph, manually typing asterisks or star characters is highly inefficient. To force Excel to mathematically duplicate and stamp a specific text string a precise number of times, you must use the REPT (Repeat) function.

How the REPT Function Works

The REPT function is a pure character-duplication engine. It takes a specific text string and violently clones it over and over again based on a hard-coded numerical multiplier.

The syntax requires exactly two arguments: =REPT(text, number_times)

  • text: The exact character, word, or symbol you want to duplicate. (This must be wrapped in quotation marks).
  • number_times: The mathematical exact number of clones you want to generate.

Building In-Cell Bar Graphs

The most powerful use case for the REPT function is generating instant, lightweight data visualizations directly inside a standard spreadsheet cell.

Imagine cell A2 contains the number 15 (representing sales for the day). You want to draw a bar graph next to it in cell B2. Instead of inserting a heavy graphic, you can use REPT to duplicate a vertical pipe character (|).

=REPT("|", A2)

Excel instantly looks at cell A2, sees the number 15, and violently stamps exactly 15 vertical pipes into cell B2 (|||||||||||||||). If the number in A2 changes to 5, the “graph” instantly shrinks to 5 pipes. It is a highly responsive, zero-latency visual indicator.

Creating Rating Systems

You can use the exact same logic to generate visual rating systems using standard emoji characters or ASCII symbols.

Imagine cell C5 contains a customer rating of 4. In cell D5, you want to display four physical star symbols.

=REPT("⭐", C5)

The engine instantly outputs ⭐⭐⭐⭐ into the cell. This technique allows you to build incredibly beautiful, highly readable financial dashboards and reports without ever opening Excel’s heavy, memory-intensive Chart builder.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.