Lightweight data exploration in Excel

Lifehacker, delicious folks! This post generated a ton of great community ideas. Check out our followup post to see some more ideas and to download a spreadsheet with demos. Thanks.

We often are given a chunk of data in Excel that we need to explore. Of course, the first tool you should pull out of your toolbox in cases like this is the trusty PivotTable (it slices, it dices!). But at times we have to dig a little deeper into the toolbox and pull out the in-cell bar chart. Here's what it looks like.

In cell bar charts in Excel

This picture shows some Major League Baseball data. I'm graphing the number of walks each player has taken. The bar graphs are built using the Excel REPT function which lets you repeat text a certain number of times. REPT looks like this:

=REPT(text,number_of_times)

For instance, REPT("X",10) gives you "XXXXXXXXXX". REPT can also repeat a phrase; REPT("Oh my goodness! ",3) gives "Oh my goodness! Oh my goodness! Oh my goodness! " (my daughter's an Annie fan).

For in-cell bar charts, the trick is to repeat a single bar "|". When formatted in 8 point Arial font, single bars look like bar graphs. Here's the formula behind the bars:

The formula behind the bar

What are some practical uses of in-cell bar graphs? For starters, they offer a good way to profile a dataset that has hundreds or thousands of rows. Here's a picture of in-cell bars compared to a standard excel bar graph for a dataset with about 500 rows. It can be a lot easier to scan the results when they're in-cell.

Exploring tall data with in-cell bar graphsExploring the same data with an Excel bar graph

Another usage is lightweight dashboards. The report below compares a number of metrics for players using both in-cell bar graphs as well as conditional formatting. The conditional formatting highlights the top 25% of each metric in green and the bottom 25% in red, but that is a story for another day.

The formula behind the bar

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.

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


March 3, 2010
Mark said:

At 100% zoom try Arial Narrow at 8pt and the following formula: =CONCATENATE(REPT("|",C6/20)," ",C6) change the params to your requirements - the 'C6' at the end puts the value of the cell at the end of the bar.
What I would like to know is how to use and Alt+code in the function - anyone?


March 28, 2010
KevM said:

Mark - to use the Alt+ code, just use the CHAR(n) function, e.g. =REPT(CHAR(65),A1)


March 30, 2010
ward said:

We've built a handy low-cost alternative to loading and pivoting it.
Together with what you've described above, it would be more than a lightweight form of data analysis. See http://www.nextanalytics.com


May 25, 2010
Prashant said:

instead of I use G and change the font to webdings.... this will create bar chart effect on excel within the table...

You can also explore rotating the text to 90% and the bars will become vertical... within the table.


July 13, 2010
adam said:

Excel 2010 has a feature called sparklines that also accomplishes this in a simple fashion.

Your name

Email (optional, will not be shared)

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

Your comment


Add a comment