Microsoft Excel is incredibly powerful at manipulating numbers, but it can also manipulate raw text characters to create stunning, cell-based visual dashboards. If you want to create a simple, horizontal bar chart directly inside a cell without dealing with the complex, floating graphical Chart engine, you can use a hidden text-manipulation function called REPT. This function allows you to instantly generate “sparklines” (tiny, inline charts) using standard keyboard characters.
How the REPT Function Works
The REPT (Repeat) function is extremely literal. You hand it a specific text string (like a letter, a word, or a symbol), and you tell it exactly how many times you want it to repeat that string back to you. It outputs the result as one massive, continuous block of text.
The syntax requires two arguments: =REPT(text, number_times)
- text: The exact character you want to repeat (must be enclosed in quotation marks).
- number_times: A numeric value (usually referencing another cell) dictating the repetition count.
How to Create an In-Cell Bar Chart
Imagine you have a sales dashboard. Column A contains the names of your salespeople. Column B contains the exact number of cars they sold this month (e.g., John sold 14 cars). You want Column C to display a visual bar chart representing those sales.
Instead of building a massive graphical chart, we will use the “pipe” character (|) found on your keyboard (usually located above the Enter key) to draw a bar.
Click into cell C2 and type:
=REPT("|", B2)
Excel will instantly output exactly fourteen pipe characters perfectly stacked next to each other (||||||||||||||). To make it look like a solid, professional bar chart, highlight column C and change the font to Playbill or Impact. The pipes will merge together, creating a thick, solid horizontal bar that perfectly matches the mathematical value in column B.
Creating Dynamic Star Ratings
The REPT function is not limited to standard keyboard keys. It can use any ASCII or Unicode symbol, including the standard Windows Star icon. If you have a customer feedback survey where cell A2 contains a rating from 1 to 5, you can use REPT to generate visual star ratings.
On a Windows machine, press the Windows Key + Period (.) to open the emoji keyboard, and search for the Star emoji (⭐).
In cell B2, type:
=REPT("⭐", A2)
If A2 contains the number 4, the cell will instantly output ⭐⭐⭐⭐, giving your dashboard a highly polished, interactive visual flair without relying on cumbersome conditional formatting rules.