More on Excel in-cell graphing

We received an enthusiastic response to our post on in-cell bar graphs in Excel. The community quickly explored every edge case. I want to highlight some of the great ideas raised.

Henk was first out of the gate with a great suggestion that two columns could be used to show positive and negative values. What he's thinking of looks like this:

Using two columns to show positive/negative values

Clint compares this approach favorably to the upcoming Excel 12's gradient fills. Here's a comparison:

Excel 12's in cell bar graphs—the gradient fill is poor designExcel 12—the gradient fill is bad infographics

In cell bar graphs using rept--looking goodIn cell graphs--better

Benjamin Selmer, derek, and Chris Grant had some nice ideas to improve the look of the bars by choosing different fonts or characters. Fonts that may work include Niagara Solid and Stencil.

You can also use characters other than a bar to nice effect. Here's a dot graph created by repeating spaces terminated with the letter "o".

An in-cell dot graph

Here's an anchored dot graph created by repeating dashes terminated with the letter "o".

An in-cell anchored dot graph

You can also label the bar with a value by concatenating the value after the bars. Remember, you can use "&" to glue together text strings in Excel formulas.

A labeled bar graph

You can change the width of the bar by dividing the value your graphing by some numbers.

Changing the width of bar graphs

Some folks raised the interesting (some would say perverse ;-) ) idea of using this technique to create Gantt charts. Here's an example. I'm using the fact that the width of a space character is exactly 1.5x the width of a bar character in Arial to make this work.

A lightweight Gantt chart

Finally, here's an Excel spreadsheet illustrating all these techniques.

Excel in-cell graphing ideas.xls

It's humbling to see the explosion of interest and all the great and diverse ideas. Thank you to all contributors.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. All source code is released under a BSD License unless otherwise specified.

98 comments | Show all comments only the last 5 are shown


August 9, 2009
Flavio said:

Fantastic,
I was looking for an application like that and you show a very simple and perfect way to do. Thanks! Flavio/Brazil


October 21, 2009
Debajit said:

This is absolutely fantastic!!!


November 22, 2009
HiEconsulting said:

This is an excellent post. Even as an power excel users, I still find more great tools everday from posts like this in the Excel community. Keep up the great tips!


December 3, 2009
uaJeremy said:

I love this approach...here is a slight modification to have the bar chart for the max value fill the entire width of the cell, and then all other values to be proportionate.

this formula goes into B1 creating a bar chart based on the value in A1. (All graphed values are located in Range A:A)

=REPT("|",ROUNDUP(A1*(CELL("width",B1)/MAX(A:A)*7),0))

the constant "7" works for "Niagara Solid" 8 pt. font and 100% zoom setting. It needs to be adjusted for different font and worksheet zoom settings.

my favorite settings with 100% zoom -
Niagara Solid 4 pt. Bold - change 7 to 3.5
Haettenschweiler 12 pt. - change 7 to 1.75

the cool thing about the formula is that the bar length will be calculated based on the current column width. change the column width and force a recalculation of the worksheet and the bar lengths will change automatically.


January 20, 2010
LarryD said:

I used additional functions to place a the total of two cells and formatted the %'s at the end of the graph.

=REPT("|",(B131+D131)*100)&" "&TEXT(D131+B131,"###,##0%")&""

Your name

Email (optional, will not be shared)

Type the word "juice" (required to confuse the spammers)

Your comment


Add a comment