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

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


April 13, 2008
Alan said:

I liked the idea of having both neg and pos values in a single column. I used the Fixedsys font to get a monospace look and feel.

I developed this very cumbersome formula. It works, but perhaps someone here could find a simpler approach.

Basically, I padded the spaces to the left so that the "o" charater would define the bulk of the data with the "|" becoming the centerline. To pad the cells properly, I had to find the minimum value for the entire region of data.

I was using the rand() function to test this and had some rounding problems that prevented alignment, so I used the round() function several times. As I said, it looks unweildy, but it works.

Here is a sample assuming the data is in cell B2 and assuming that all data is input in cells B2 through B7.

=iF(B2<0,REPT(" ",IF(MIN(B$2:B$7)<0,ROUND(-MIN(B$2:B$7)+ROUND(B2,0),0),ROUND(MIN(B$2:B$7),0)))&REPT("o",ROUND(-B2,0))&"|",REPT(" ",IF(MIN(B$2:B$7)<0,ROUND(-MIN(B$2:B$7),0),ROUND(MIN(B$2:B$7),0)) )&"|"&REPT("o",B2))

See what you think.
Alan


May 9, 2008
Klemen said:

Thank you Alan, great job!


May 21, 2008
Harry said:

Any pointers to data-manipulation tools/methods when the data isn't numeric? I am trying to support some folks who are trying to leverage Excel as a "database"....


May 27, 2008
ARS said:

I simplified your approach. Requires 2 columns but gives you the ability to have red and green text for the negative and positive values.

Left column right justified.
=IF(B3<0,REPT("o",-B3),"")

Right column left justified.
=IF($B3>0,REPT("o",$B3),"")


June 6, 2008
Warren said:

That's a great little tip.

Thanks!

Your name

Email (optional, will not be shared)

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

Your comment


Add a comment





It's complicated so shut up

Ze Frank produces a smart, funny daily video blog. A viewer wrote in to say Ze shouldn't discuss a particular topic because "it's complicated". I think Ze Frank's response is great.

Folks build walls in a business by saying, "You couldn't understand what we're doing, it's complicated," "You can't question that policy, it's complicated". It's natural to want to fend off difficult questions but it leads to a siloed business with an "us vs. them" mentality and can stifle innovation.

This show may not be safe for work—it contains salty language. Listen with the headphones on the first time.

1 comment


September 3, 2006
Zoroboaster said:

Interesting

Your name

Email (optional, will not be shared)

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

Your comment


Add a comment