Mapping relationships between people using interactive network chart

Share

Facebook
Twitter
LinkedIn

Today, lets learn how to create an interesting chart. This, called as network chart helps us visualize relationships between various people.

Demo of interactive network chart in Excel

First take a look at what we are trying to build.

Network Relationships - Interactive Chart in Excel - Demo

Looks interesting? Then read on to learn how to create this.

Note: thanks to Hans whose email question inspired me to create this chart.

Tutorial to create interactive network chart in Excel

Note: This tutorial requires intermediate-to-advanced Excel knowledge. So if you are beginner, learn the basics & advanced concepts first and then comeback for this.

In order to create this chart in Excel, we need to first understand various ingredients of it.

As you can see, the chart contains these parts:

  1. A set of dots, each representing one stakeholder
  2. A set of grayish thick & dotted lines representing all relationships between people.
  3. A set of green thick & blue dotted lines representing relationships for the selected person.
  4. A slicer for person selection (can be replaced with list box or clickable cells in Excel 2007 or below)
  5. Summary statistics of the selected person

Getting started with the relationship data

To simplify our tutorial, lets assume we are talking about relationships between just 4 people, named Ash, Billy, Cynthia & Darren.

Our relationship matrix looks like this:

Data - Relationship matrix - network chart in Excel

  • 0 means no relationship
  • 1 means weak relationship (for example: Ash & Billy just know each other)
  • 2 means strong relationship (for example: Cynthia & Billy are friends)

The downloadable workbook is created to take up to 20 stakeholders.

Geometry of the network chart

If we draw the relationships between these 4 people (Ash, Billy, Cynthia & Darren) on a paper, it would look like this:

Hand-drawn relationship network map

The 2 things we need to determine are,

  1. The location of dots (where person names are printed)
  2. The lines (starting & ending point of lines)

Plotting dots around circle

We need to plot our dots in such a way that gap between each dot is same.  This will create a balanced chart.

What shape satisfies our need for such equal gaps? A circle of course.

Hey wait, I don’t see a circle in the chart you have shown…?

Thats right. We don’t need to draw a circle. We just need to plot dots around it.

  • So we have 4 stakeholders, we need 4 dots
  • If we have 12 stakeholders, we need 12 dots
  • If we have 20, we need 20 dots.

Assuming the origin of our circle is (x,y), radius is r and theta is 360 divided by number of dots we need,

the first dot (x1,y1) on the circle will be at this position:

x1 = x + r*COS(theta)

y1 = y + r*SIN(theta)

[Related: How to create a spoke chart in Excel]

Once all the dots are calculated & plugged in to an XY chart (scatter plot), lets move on.

Plotting the lines

Lets say we have n people in the network. So that means, each person can have a maximum of n-1 relationships.

So the total possible lines in our chart are n*(n-1)/2

We need to divide it by 2 as if A knows B, then B knows A too. But we need to draw only 1 line.

My network chart template is set up to work with up to 20 people. So that means, the maximum number of lines we can have will be 190

Each line requires a separate series to be added to the chart. That means, we need to add 190 series of data just for 20 people. And that satisfies only one type of line (either dotted or thick). If we want different lines based on type of relationship, then we need to add another 190 series.

This is painful & ridiculous.

Fortunately there is a way out.

We can use far fewer series and still plot the same chart.

Lets say we have 4 people – A B C & D. For the sake of simplicity, lets assume the co-ordinates of these 4 are

  • A – (0,0)
  • B – (0,1)
  • C – (1,1)
  • D – (1,0)

And lets say, A has relationships with B, C & D.

That means we need to draw 3 lines, from A to B, A to C & A to D.

Now, instead of supplying 3 series for the chart, what if we supply one long series that looks like this:

(0,0), (0,1), (0,0), (1,1), (0,0), (1,0)

That means we are just drawing one long line from A to B to A to C to A to D. Agreed that it is not a straight line, but Excel scatter plots can draw any line as long as you provide a set of co-ordinates.

PS: This is a trick I learned from Roberto of E90E50. He used this trick in the winning entry of our recent dashboard contest.

See this illustration to understand the technique.

Using a single series to draw multiple lines in Excel XY chart

So instead of 190 series of data for the chart, we just need 20 series.

In the final chart, we actually have 40 + 2 + 1 series of data. This is because,

  • 20 lines for weak relationships (dotted lines)
  • 20 lines for strong relationships (thick lines)
  • 1 line for highlighted person’s weak relationships
  • 1 line for highlighted person’s strong relationships
  • 1 set of no line & just dots for the people

How to generate all the 20 series of data:

This requires following logic:

  • Assuming we need lines for the relationship of person n.
  • That person’s dot location will be (Xn, Yn) and already calculated earlier (in the plotting dots around circle)
  • We need total of 40 rows of data
  • Every odd row will have (Xn, Yn)
  • For every even row
    • Divide the row number by 2 to get person number (say m)
    • (Xn,Yn) if there is no relationship between n and m
    • (Xm,Ym) if there is a relationship

We need MOD & INDEX formulas to express this logic in Excel.

Examine the download workbook to understand how its done.

Once all the line co-ordinates are calculated, add them to our scatter plot and format.

I used a macro to automate the formatting. It can be done manually too, just takes a little patience.

Slicer for selecting a person

This works only in Excel 2010 or above.

Select the first 2 columns of relationship matrix & create a pivot table.

Now, insert a slicer on Person name column.

Slicer for person selection - network chart

Using simple IF formula, extract the selected person name from pivot table (examine download file for the logic).

And using the name, extract the subset of line data to separate range (2 sets of data – one for weak & one for strong relationships)

Add this new data to our scatter plot and format.

Format the slicer (using slicer styles) so that it looks slick.

Related: formatting slicers using styles.

NOTE About Slicers: If you change or add any data, you must refresh (from Data ribbon) to update the slicer. This can be automated with a macro, but I want to keep this file macro free.

[Alternative] Selecting a person with form controls

You can use either a list box or a range of clickable cells. See the 2003 compatible download file for an example of this.

Summary statistics

Using simple formulas extract statistics for the selected person and show them near the chart.

Summary statistics - Network chart in Excel

Adding labels to the chart (person names)

In our chart, we are showing person names instead of regular label like X or Y value. This is done with value from cells label feature in Excel 2013.

Labels for Excel scatter (XY) plot - done using Excel 2013 or add-in in earlier versions

For earlier versions of Excel, I recommend using Rob Bovey’s excellent XY Chart Labels add-in.

Putting it all together

Once everything is ready, clean up the chart, slicer and other elements, put them together. And we are ready to go.

Relationship Network in an interactive Excel Chart

Download Network Relationships Interactive Chart Template

Click here to download the chart template workbook. The download is a ZIP file and it contains 3 workbooks – compatible with Excel 2013, 2010 & 2003+. Use the version that you need.

Please examine the formulas & chart settings to understand how it is constructed.

Note: Hit Refresh from Data ribbon to change slicer once you have added or modified data.

When to use network relationship chart?

A network graph is a good place to explore relationships between people in a project or team. It is especially useful when selecting a sub-set of people from large group to closely work on a project.

Any alternatives?

There is a popular Excel Add-in named NodeXL that can help you visualize and analyze relationships between people in a more in-depth fashion.

Check out Chord diagram & Cosmograph from E90E50 site for other ways to present this data.

Do you use these kind of charts?

I have used network charts earlier to depict relationships between various people or things. But I have never created such charts in Excel, I always used either Power Point or some other drawing program to create them. That is why I am excited about this chart. Figuring out the formula & graphing logic was fun.

What about you? Have you used such charts before? How do you like the network chart presented here? Please share your thoughts using comments.

 

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

31 Responses to “Beautiful Budget vs. Actual chart to make your boss love you”

  1. Harry says:

    Would be considerably easier just to have a table with the variance shown.

  2. Jomili says:

    On Step 3, how do you "Add budget and actual values to the chart again"?

    • Chandoo says:

      There are a few ways to do it.

      Easy:
      1) Copy just the numbers from both columns (Select, CTRL+C)
      2) Select the chart and hit CTRL+V to paste. This adds them to chart.

      Traditional:
      1) Right click on chart and go to "select data..."
      2) From the dialog, click on "Add" button and add one series at a time.

      • Neeraj Agarwal says:

        One more way to accomplish it is just select the columns into chart. Press Ctrl+C and then press Ctrl+V

        Regards
        Neeraj Kumar Agarwal

  3. TheQ47 says:

    Unfortunately, this doesn't seem to work for me in Excel 2010. The "Var 1" and "Var 2" columns cannot combine two fonts to display the symbol and the figure side-by-side.
    Secondly, there is no option to Click on “Value from cells” option when formatting the label options. The only options provided are Series Name, Category Name or Value.

    • Chandoo says:

      @TheQ47... the emoji font also has normal English letters, so if you use that font, then you should be ok. I am assuming your computer doesn't have that font or hasn't been upgraded for emoji support.
      Reg. Excel 2010, you can manually link each label to a cell value. Just select one label at a time (click on labels, wait a second, click on an individual label) and press = and link it to the label var 1 or var 2.

  4. Neeraj Agarwal says:

    I am using excel 2010, please explain how to apply Step 12

    Regards
    Neeraj Kumar Agarwal

  5. mariann says:

    Hi Chandoo,

    I just found your website, and really love it. It helps me a lot to be an Excel expert 😉

    Currently I am facing with a problem at step 11:
    Var1 Var2
    D30%
    A5%
    B0%
    B4%
    B7%
    C10%
    C13%
    D27%
    I42%

    Though at mapping table, I used windings, here formula uses calibra. How I can change it? I am able to change only the whole cell. In this case numbers will be Windings too.

    Thanks for your help!

    • Chandoo says:

      Hi Mariann... Welcome to Chandoo.org and thanks for your comment.

      If you wanted to use symbols from wingdings and combine them with % numbers, then you need to setup two labels. One with symbol, in wingdings font and another with value in normal font. Just add the same series again to the chart, make it invisible, add labels. You may need to adjust the alignment / position of label so everything is visible.

  6. […] firs article explains how you can enhance your charts with symbols. You can simply insert any supported symbol into your data and charts. To some extend you can […]

  7. Franciele says:

    You're a good person, thank you to share your knowledge with us, I will try to do in my work

  8. Ali says:

    Great visualization of variance. My question is that is this possible in powerbi?

    How would you go about it?

  9. NARUTO says:

    HELLO, WHY CANT I FIND VALUES FOR LABELS IN EXCEL 2013

  10. Amol says:

    Dear chanddo sir,

    What to do if we have dynamic range for Chart. How this will work. can you able to make the same thing works on dynamic range.

  11. Ricardo says:

    Sir Chandoo,

    Good Day!
    First, I'd like to say that I am very grateful for your work and for sharing all these things with us.

    I tried to do this chart but it seems that the symbols don't work with text (abs(var%),"0%") unless we keep the Windings font style.
    The problem is, it converts the text into symbol as well and you wont see the 0% anymore. I'm using Windows 7.

  12. MF says:

    WOW - Segoe UI Emoji
    This is the greatest discovery for me this month 🙂 Thanks for sharing.

    Here's my two-cents:
    https://wmfexcel.com/2019/02/17/a-compelling-chart-in-three-minutes/

  13. Renuka says:

    Sir This is awesome chart, and very easy to made because of your way to explain is very simple , everyone can do. Thank you

    one problem i am facing, I hv made this chart , but when i am inserting data table to chart it is showing two times , how can i resolve this

  14. renuka says:

    in this chart when i am adding new month data for example first i made this chart jan to mar but when i add data for the apr month graphs updated automatically but labels are missing for that new month

    • Chandoo says:

      Hi Renuka,

      Please make sure the formulas for labels are also calculated for extra months. Just drag down the series and set label range to appropriate address.

  15. Justine says:

    So I am playing with the Actual chart here - but amounts are bigger than your - you have 600 as Budget - my budget is 104,000 - is there a way to shorten that I am unaware of

    thank you - I LOVE YOUR SITE

  16. Arvind says:

    Thanks for the tips and tricks on Excel. In the Planned versus Actual chart examples, you use multiple values (ex. multiple Categories in above). How can this be done when we have only 1 set of values? For example if I have only this:
    Planned Actual
    SOW Budget 417480 367551

    How can I create a single bar chart like the one above?

  17. JEREMIAH KOOL says:

    Thank you Chandoo.
    This one is just perfect for my Quarterly Review presentation on Operational Budget against Actual Performance for the Hospital I'm currently working with.

    Just Subscribed today (10 minutes ago)

  18. Shawn says:

    Is there a way to make the table of data into a pivot table to be able to add a slicer for the graph due to many different categories and months?

  19. Mihail says:

    Hi, I tried to modify you template with something appropriate for me, and I found a problem. this template was modified by me started with excel 2010, then 2016 and finally 2019. Same thing - somehow appear an error - or didn't show the emoticons for positive percentage or doubled the emoticons for some rows. I suspect to be from excel. if is need it I can sand you my xlsx for study. Please help if you can.

  20. Saidatta Pati says:

    Hi Chandoo,
    Could you please check the Var Formula in Step1. You have mentioned budget-actual and when i did this i got different values but when reversed like actual-budget i got the actual value what you have demonstrated in step1.
    Please share your view.

  21. Dan says:

    This is a great chart (budget vs. actual). However, in trying recreate it, I cannot color in the UP Down bars individually, and they all become formatted with the same color. I'm using Office 365. Look forward to the feedback.

    Thanks.
    Dan

  22. sathik says:

    pls explain in detail step 7

  23. Arun says:

    While in the Excel sheet you have used following formula for Var
    Var = Actual - Budget
    But
    in the note, you have written
    Var = Budget - Actual

  24. aye myat maw says:

    Good Presentation and Data information.thank you so much chandoo.

Leave a Reply