Tag: Excel

Sankey Diagrams in Excel

Mark over at the Excel Off The Grid blog has a great new post on how to ‘Create a Sankey diagrams in Excel’.

Mark shows how to build a simple 2 category relationship diagram by using stacked area charts and reversed stacked bar charts. By layering the individual charts with mostly transparent colors (except the actual arrow), he manages to get a very neat diagram. It even allows changing the spacing between the start and end nodes, as well as the segment length of the horizontal first and and last arrow segment.

That is ‘big ass’-Excel usage!! Check out this video to see how the source data is prepared (some SUMIFs involved here) and the Sankey diagram is made. It is well worth watching all 18 minutes, in my opinion.

And if you want to try it out, you can download the template and start building from there. Read Mark’s post here.

Excelling in Excel

Does it take a hero like Daniel Ferry from the Excelhero blog to do a Sankey diagram in Excel? Well, you may not have to be a hero, but as Daniel puts it, this is “… seriously tedious work, as Excel has no native chart type to do what is required automatically.”

Daniel used the LLNL 2008 U.S. energy flow charts as model for his Sankey diagrams in Excel. Here is what he came up with (clipped section):

Actually the result is quite close to the original Sankey diagrams, with similar colours, arrow routing, and even the same fonts.

Daniel explains:

“I lightened the colors on the input boxes (had to do it), but otherwise I think my rendition is faithful to the original. I may have stayed too true to flow pipe proportionality. Some of them are so thin they do not print well. This should be addressed. While my pipes are seemingly lined up, they will not survive the chart being resized vertically without some small errors, either gaps in a pipe stack, or overlap.
(…)
An interesting project would be to create an Excel addin that would allow you to specify category box locations and have VBA do all of the grunt work in lining up the flow pipes, automatically creating the chart. (…) In it’s current form no VBA was used. “

So, if you wish to draw a Sankey diagram with the Microsoft Office package installed on your computer, and enjoy using VBA, you might want to give it a shot. Gabor Doka’s Sankey helper (an Excel macro) is another option. Dedicated Sankey diagram software tools are available. It would recommend one of those, if you need to produce more than one Sankey diagram, or wish to make updates to your diagram and layout adaptations more comfortably.

BTW, here is the story on the man behind the Sankey diagrams at LLNL.