When you are creating an Excel Dashboard and are limited by space and do not want to insert a chart, you can easily create an in-cell bar chart using the REPT (repeat) function. The REPT function uses the vertical bar character | as the first argument: text and references the value cell for the second argument: number_times. So it enters the vertical bar character by the amount of times of the value cell, looking something like this: ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Key Takeaways
-
Create Visual Bars Inside Cells – The
REPT
function can repeat a character (like “|” or “█”) based on a value, visually representing data directly in cells. -
Simple and Formula-Based – No need for charts; just combine
REPT
with numeric data to build a lightweight visual aid. -
Customizable Appearance – You can use different characters and colors (via conditional formatting) to enhance visual clarity.
-
Great for Dashboards – In-cell bars keep your layout compact, making them perfect for minimalist dashboards and reports.
-
Scales Easily with Normalization – Normalize values by dividing each by a maximum, ensuring proportional bar sizes.
Table of Contents
In-Cell Bar Charts with the REPT Function
STEP 1: Enter the REPT function in a column next to your values
=REPT(text,number_times)
STEP 2: Enter the vertical bar keyboard character in the first argument =REPT(“|”)
STEP 3: Reference the value cell for the second argument =REPT(“|”, a1)
STEP 4: Highlight the formula column and insert the Stencil font from the Home menu and choose a font color
STEP 5: If your value cells are high, the bar will go out of your screen. To fix this, you need to enter a divisor in the second argument of your formula which will reduce the length eg =REPT(“|”,a1/5)
Frequently Asked Questions
What is the REPT function in Excel?
The REPT
function repeats a specified text string a given number of times. It’s often used to create text-based visuals like in-cell bar charts.
How do I use REPT for bar charts?
Combine a repeated character like “|” or “█” with a numeric value, e.g., =REPT("█", A1)
, where A1 contains the number to visualize.
How can I adjust the scale of the bar chart?
Divide each value by a factor to limit the bar length, e.g., =REPT("█", A1/10)
to scale values down by a factor of 10.
Can I apply colors to in-cell bar charts?
Yes, use conditional formatting to change the font or cell color based on the value, making the bars more visually appealing.
Is the REPT bar chart better than a standard chart?
It’s not a replacement but a space-saving alternative ideal for compact views or dashboards that require minimal formatting.
John Michaloudis is a former accountant and finance analyst at General Electric, a Microsoft MVP since 2020, an Amazon #1 bestselling author of 4 Microsoft Excel books and teacher of Microsoft Excel & Office over at his flagship MyExcelOnline Academy Online Course.