In-cell Bar Charts Using the REPT Function

This section of the forum needed a post, so here’s a trick. You can create in-cell bar charts using the REPT function, like this:

=REPT(“█”,3)

image

or for more robustness, where B6 is the cell containing the number:

=IF(ISBLANK(B6),"-",REPT(“█”,B6))

You can change the color of the bar by changing the font color.

This type of chart (if using dots) would be called a dot plot, so the length of the bar is discrete rather than continuous, but if you are okay with that, you can scale the chart to a length of up to 10 characters by rounding, like this:

=REPT(“█”,ROUND(10*value/MAX(range_of_values),0))

Almost as good as in-cell data bars, but it requires two columns. Still, this lets you use any unicode character you want (instead of the block character).

8 Likes

This is so cool :star_struck:

A template is now included in the gallery titled “Pros and Cons with Tornado Chart” which demonstrates the use of this technique and the formulas.

2 Likes