This is a guest post by Krishna, a football lover & one of our readers. He is also a student of Chandoo.org online VBA classes.
The wait for lifting the most valued priced in football for Germans was finally over. For a football fan, world cup is best time that is scheduled every four years and that if your favorite team lifting the trophy is like your crush is going on a date with you. 🙂
A sneak-peek at the final dashboard
Here is the final dashboard (it has more functionality than depicted). Click on it to enlarge.
Download the dashboard workbook
Click here to download the workbook. Refer to it while reading this article for most benefit.
How it all began…?
So, after the world cup, I have thought to analyze this tournament using excel. And also Chandoo’s podcast session 13 made me more excited to start on this.
I have started the by searching for information over net and thanks to FIFA for having all the information at one place.

1. Planning of dashboard
I have made some dashboards and I think one of the essential steps to do is to plan what all needs to be represented in our dashboard. Having a checklist helps me to focus more on making it more interactive and creative rather than digging out for the data. In this dashboard, I wanted to show analysis of individual teams, matches played, and comparison of teams. However, I have added the top performers of World Cup in later stages.
2. Collecting data
Having all the data on single site is great, however exporting to excel might seem a bit cumbersome because of formatting issues. So, it’s better to use PowerQuery (a Microsoft add-in) to extract the data from sites. (I came to know about PowerQuery, PowerView and PowerPivot though Chandoo podcast session 3, an interview with Mike Alexander). This provides us the data in tabular form and that saves a lot of time in formatting, especially when you copy from web.


Once, I have the data for goals scored, I have collected data for other parameters as well and the stats are matched for the respective matches between the teams using Index-Match.
Now, we have the data related to matches played between the teams.
Similarly collect data for the teams. (FIFA.com has huge resource of information collected for this world cup)
3. What makes a team
Now, we need to make the right graphs for data representation.
For the first part of the dashboard (performance by teams) there are four areas that I wanted to show independently. I was tired of using the form controls. So, I have used the select cells control which requires a small macro and some form of conditional formatting to do the magic. For more on this technique refer to Interactive Sales Chart tutorial.
Now for the country selected there should be a flag. Here I have named all the flags with abbreviation of each country. A macro code is used to select the country flag which is the ‘Flag’ (selected cell) cell.

Scatter plot in the dashboard
The chart on the right is scattered plot, where the data points are selected as per the categories selected in the drop-down. I have used Index, Match and Choose functions to select the data points for the all the teams. The pic below is for the “Dribble into penalty area” that is under “Attack”.

INDEX($E$2:$AR$34,MATCH($AZ3,$E$2:$E$34,0),MATCH(CHOOSE($AW$16, $AU$15,$AU$16,$AU$17,$AU$18,$AU$19,$AU$20), $E$2:$AR$2,0))
Which is
INDEX($E$2:$AR$34,MATCH($AZ3,$E$2:$E$34,0),MATCH(CHOOSE($AW$16, $AU$15,$AU$16,$AU$17,$AU$18,$AU$19,$AU$20), $E$2:$AR$2,0))
INDEX($E$2:$AR$34,MATCH(Germany, Teams selected,0), MATCH(Dribble in to penalty area, row headers,0))
INDEX(Data table,1st row,19th column) = 28
Similarly the data points required for the graph are populated.

Now, for finishing, add a small box that gives few details about the team. Here, we need to accommodate all the data in the box that can be done using CONCATENATE or just simply use “&”

For e.g.,
=”Team: “&linkedCellFlag &CHAR(10) &”Stage: ” &INDEX($E$3:$F$34,MATCH(linkedCellFlag,$E$3:$E$34,0),2)
linkedCellFlag :named range for the selected team and Char(10) is required to provide ample space to goto next line.
The output will be (if I selected Germany):
Team: Germany
Stage: Winners
And similarly use & to add the data into the cells
So putting all together the final output is (yes I am a bot bad in choosing the right color scheme)
4. Match vs. Match ()
So now moving on to the next phase of the dashboard, the analysis of matches played.
Here, when I select two teams, say, Germany vs. Argentina, the match stats for corresponding teams must come up. Here, there are two things that we need to check:
- When I select Germany as my first team, I need to select all the teams against whom Germany played in this World Cup
- When selecting the match like GER vs. ARG, we need to have the same result even though I have chosen ARG vs. GER
To solve these two situations I have used the following method:
- Make a matrix of the teams played against every other teams as shown below. I have sorted the teams based on groups and using IF,MATCH, IFERROR populate the array as shown below

Formula used:
IFERROR(INDEX($AN$3:$AN$34,IF(AP$2=$AN3,” “, IF(ISNUMBER(MATCH(AP$2,GrpA,0)), MATCH(AP$2,$AO$2:$BT$2,0),””)),1),””)
For case of the selected cell, if, Brazil = Mexico, <<blank>>, If Brazil is part of Group A, then value of the team in header Row (AO2:BT2)
Similar procedure is followed for the other matches
For the drop down,
The index number (for eg., Brazil is the 1st team in the drop down bar, hence it has number 1) of the team selected and MOD (number,4) is evaluated. Corresponding teams are added from (i) (if the selected team is Spain, index number is 5, then teams are Chile, Australia and the Netherlands). Similar process is done for teams proceeded into later stages of the tournament is done.
Evaluation of the match
For the matches, when we select the teams, let say, Brazil vs. Croatia, here the home team is Brazil and away team in Croatia. So the index number assigned is “1-3”. I have defined the index number for each of the teams using CONCATENATE, INDEX, MATCH functions.
=CONCATENATE(MATCH(LEFT(F40,3), $AM$3:$AM$34,0),”-“,(MATCH(RIGHT(F40,3), $AM$3:$AM$34,0)))
F40= BRA-CRO
Hence, the formula becomes
CONCATENATE(MATCH(BRA),$AM$3:$AM$34,0),”-“,(MATCH(CRO),$AM$3:$AM$34,0)))
CONCATENATE(1,”-“,3)
Which gives 1-3
In case, I have selected to Croatia first and Brazil second, then I would have it as “3-1”, which doesn’t match with the list of matches. Hence in that case, we need to invert the number to “1-3”.
So finally, got the numbering right, which leaves us to lookup values for each category. So when I have seen initially, the list is too long. So I have decided to subgroup them.

On an average the match stats that most of us look are shots, goals, suspension, attacks, procession. However, showing many statistics is often too dangerous. So, I have adjusted to the top stats and sub stats can be viewed if one like to. For example, one wants to look in-depth about goals scored, total attacks and total passes then small box in Column AG (the one highlighted) can be used to hide the rows or show the rows accordingly. A small macro to hide/show rows is sufficient for the same.
5. Where do the teams stand
Now the third part to compare any two teams in the tournament and compare with tournament average. So this would be just a graph with all the data available. So I thought of animating the graph.
Before animation, an important thing to note is to check for the dimension of the variables we are analyzing. Since, all the data is coming on the same graph, plotting goals scored (e.g. 18) and total passes complete (e.g. 4200) in same would not help us. Hence, use total passes complete (in 100s) is to be checked. Similarly for other parameters.
For animation of the graph, I have done a similar as mentioned Chandoo in Excel VBA classes. (That course is really awesome. If you are looking to know more on excel VBA, I recommend you to join)

Top 5 teams

And at last, the comparison of top 5 teams. This is done using INDEX,LARGE formula.
INDEX($E$3:$N$34,MATCH(LARGE($I$3:$I$34,1),$I$3:$I$34,0),1)
In I3:I34, there are values of total goals scored by a team. Here we get Germany
In similar way we can check out for the remaining by substituting 1 with other numbers.
The charts are animated in the similar way as done in the previous graph, although an additional dimension is added.
So this is it. Make final touches by specifying the appropriate hyperlinks to the each section and maintaining the formatting is essential.
Thanks Chandoo for encouraging me to write a guest post.
Added by Chandoo: Thank you Krishna
Many thanks to Krishna for sharing his dashboard file & explanation with all of us. Your work is a proof of how much we can accomplish with Excel.
If you like this article,please say thanks to Krishna.
Want to learn how to create dashboards like these?
Then check out:















41 Responses to “How to use Excel Data Model & Relationships”
Data is Excel 2013 behaves so much like a OLAP cube when using with PivotTables. And this is actually wow. Consider learning not just DAX but MDX too 🙂 Happy Excel
@Chandoo.. Have a nice and safe time in US. Best Wishes. And when they are publishing your interview in Entrepreneur 🙂
I have been using PowerPivot in Excel 2010. My understanding was (via PowerPivot Pro blog) that Power Pivot would NOT be available in Excel 2013 in all versions; my recollection is that it was only going to be available in certain enterprise subscription editions. Thus, for individual users, it will no longer be available? For that reason I have moved some of my projects to Tableau, and do not expect to upgrade to Excel 2013.
Can you confirm the availability of Power Pivot for all Excel 2013 users , or will it be restricted and unavailable for some users?
@Buzz
I believe that Power Pivot is included with all MS Office installs in 2013.
Have a read of:
http://office.microsoft.com/en-001/excel-help/version-compatibility-between-powerpivot-data-models-in-excel-2010-and-excel-2013-HA103929426.aspx
http://office.microsoft.com/en-001/excel-help/whats-new-in-powerpivot-in-excel-2013-HA102893837.aspx
http://en.wikipedia.org/wiki/Microsoft_Office_2013#Comparison (Note that Excel isn't listed as having Multiple editions)
This is something that Excel is doing very poorly: letting people know what's available with what. It also doesn't help that they have so many packages and versions.
Excel Professional Plus has Power Pivot and Power View. I went through this last week. Spent 4 days upgrading from 365 Home Premium ($99 for the 1-yr subscription) to an additional $7/month for Professional Plus.
Also, one page on Microsoft's site says that their Sharepoint Online Package 2 has Power View. NO! It's not true. Sharepoint Online Package 2 will INTERACT with a spreadsheet that has PP or PV, Package 1 will not.
Just this weekend I upgraded from Home Premium to Professional Plus and spent time with Power View and PowerPivot.
Up to that point I never saw myself in VLOOKUP Hell, and it may not be going away any time soon. I'm surprised to discover how many of my clients are still on Excel 2003. And then I have Mac users who don't have a lot of this great stuff available to them at all.
These are great features and I'm going to dive into the Data Models. Unfortunately, I suspect, for me, the practical use may be limited to blogposts because I can't teach Power View in my workshops or send a client a spreadsheet that has a Power View in it.
Hi OZ,
I think the Microsoft would only upgrade the excel to a certain level instead of making it so powerful that it might threat their BI product. You know these "powerful" stuff can be easily done with a entry level crystal reports version.
Glad to listen to ur opinion on it.
I spent quite some time and energy on Excel and used it a lot, but now I am focusing energy on BI software like crystal reports.
We both know that based on the technology today. All the time we spend on the Macro and advanced function of Excel can be done easily with other softwares which costs only hundreds of bucks.
@Thondom
I don't think Excel tries to be the solver of all problems
It is a generic tool
Which for about 95% of people will do what they want 95% of the time
There will always be specifics where specific custom software will do better than Excel
It is the commonness of Excel which means that I can send a model to you and it will work , most of the time, that is its strength, of course combined with its flexility in being able to be adapted to suit most needs
Hi Hui,
You are right.
But,
for the business and individual, who spend too much resource on Excel to meet their BI requirements and other processing requests.
Should they open their eyes to other ways to do it, in this age? Especially for many people try too much time to process stuff with thousands lines of macro programming.
It is just as when human being created gun fire, the martial arts would not be that effective.
Ppl need to be prodent when they choose their solution.
Hi guys, I just came across your conversation. I have an example of BI vs. Excel stuff. Here in Russia there is an ERP-system called "1C". It became a defacto standart for accounting, planning and BI / analytics. It is positioned as a flexible and powerful system and it really is.
But its reporting abilities aren't user-friendly (or maybe just not me-friendly).
Many reports require programming and all those SQL things, so that is common for a company to have a couple of programmers who develop and code those reports.
So the common solution is to export data to Excel and then process it to be more suitable for further analysis or reporting.
Well, it's obviously not a rule of thumb that special BI software can outperform Excel in day-to-day routine.
Hi Chandoo, thanks for publishing great Excel information. Pardon the ignorance as I havent used Data Model nor PowerPivot. But having seen your video clip on PowerPivot, how does Data Model differ from PowerPivot - the "process" seems familiar? Have a great day! And Excel to new heights! Regards,
@Tris, one main difference is that Data Model is part of Excel Home Premium. You've got to upgrade to ProPlus to get PowerPivot and Power View.
Also, keep in mind that Data model only lets you combine tables. If you want to create powerful measures (for example show % improvement over last year sales), then PowerPivot is the way to go. For a tour of PowerPivot, visit http://chandoo.org/wp/2013/01/21/introduction-to-power-pivot/
Excellent posting, some pride themselves for having sheets with thousands of formulas or complicated formulas, but in the end the important thing is to work as little as possible.
@Nolberto let's not gloat yet. Some people are forced to have thousands of complicated formulas when they don't have the fancy tools. I'm sad for the 2003 users who have to use SUMPRODUCT when the rest of us have SUMIFS available.
In the end, I think the important thing is clean, trustworthy data--however you arrive at it. People survived more than 300 years with slide rules and paper. No PowerPivot for the Wright Brothers.
hi chandoo,
i added 2 column into sales, 1st column vlookup customer ID to CUST sheet to get the male or female, then 2nd column vlookup Product ID to Product sheet to get the product name, then after that i make pivot table out of sales sheet.
but then the result is really different from yours
the purposes is just try to do the vlookup vs add to data model to see if they get same result
thanks
Hi Koi,
We are using gender vs. category in the report. Can you try with that? I am sure the results will match.
ups sorry, didnt see that you're filtering using slicer..then it is good now the result are same with less effort 🙂
thanks
Hi Chandoo, .I am interested to know whether we can build a star schema or snow flake data models through relations in Excel? (trying to correlate with Qlikview)
Hi there,
You can create a Star schema for sure. Snow-flake is possible too. As long as all relationships are one to many (or one to one) anything is possible.
What if customer.profession change its value after sometime?
Supposed we have monthly data for Sales. What if one customer is a doctor in Feb, then a pilot in October, for example?
How to build data model for such that situation?
Thank you.
[...] Introduction to Excel 2013 Data Model & Relationships [...]
Hello ,
I find this option similar to that of MS Access.
In MS Access as well we have relationship concept and once you create a relationship, you can start creating number of queries based on that.
But MS Access is not so user friendly and basically its database. Good that we are getting those options/functions in Excel.
Thanks for sharing this info.
Regards,
Raghavendra Shanbog
What is star schema and snow flake.??? Can we have next article on that if it is useful for us???
Hi there, can anyone help? I tried testing this out in Excel using two tables. When I go to the Data tab the Relationships button does not appear at all. I am using Microsoft version 14.0.4760.1000, Microsoft Office Professional Plus 2010. Does this version have this capability? Or is there an add-in required?
[…] even a layperson can perform if they have the almighty Excel 2010 and PowerPivot installed. Or Excel 2013′s Data Model, which lets you mash up data from Excel Tables and serve them up directly as PivotTables with not a […]
Chandoo/Hui,
The dates grouping feature does not seem to work in Data Model. Is that true or am I making a mistake somewhere?
I don't think this is really for "lookups"...
Try creating a pivot with sale ID and customer name in row fields. It will give you ALL customer names per sale ID.
You'd need to use RELATED function in a new column in powerpivot if you want something equivalent to "vlookup"
Please explain the difference between data model and power pivot, the functions of both of them are different and similar
thanks
[…] Handling large volumes of data in Excel—Since Excel 2013, the “Data Model” feature in Excel has provided support for larger volumes of data than the 1M row limit per worksheet. Data Model also embraces the Tables, Columns, Relationships representation as first-class objects, as well as delivering pre-built commonly used business scenarios like year-over-year growth or working with organizational hierarchies. For several customers, the headroom Data Model is sufficient for dealing with their own large data volumes. In addition to the product documentation, several of our MVPs have provided great content on Power Pivot and the Data Model. Here are a couple of articles from Rob Collie and Chandoo. […]
I need to use a slicer to allow a user to select vendor by name. In the background, I need to obtain the vendor ID to link to multiple datasets where the name may not be spelled consistently. Any advice?
@Bernadette
You can use the technique described here:
http://chandoo.org/wp/2016/05/11/apply-conditional-formatting-using-slicers/
I'd suggest try that and then if you have troubles ask the question in the Chandoo.org Forums http://forum.chandoo.org/
Attach a sample file to simplify the response
I've tried this in Excel 2016. It works great.
I can even create Cube Formulas on the Data model after I've inserted the pivot table.
Just for the fun of it, I tried to see if I could do Cube Formulas without creating the pivot table in advance. I can define Cube members, but it seems as if the measure part is playing tricks on me.
I can't get a Cube Value for Chocolates sold to Male customers.
With the Pivot created the formula looks like this (and works fine)
=CUBEVALUE("ThisWorkbookDataModel";"[Customer].[Gender].&[Male]";"[Product].[Category].&[Chocolates]";"[Measures].[Sum of Quantity]")
Does anyone know how I can solve this, or am I asking the impossible?
I want to see the video on this topic
What if customer.profession change its value after sometime?
Supposed we have monthly data for Sales. What if one customer is a doctor in Feb, then a pilot in October, for example?
How to build data model for such that situation?
Thank you.
In such case, you need to make relationships based on two columns. This kind of feature is not supported in Excel. You can use Power Query to merge tables based on multiple columns and return a consolidated giant table to Excel for reporting.
Is it able in MS Access?
I have never used access before.
thanks chandooo your article is very helpfull for troubling peoples' especially in office environment under boss pressure.
Here is an introduction to PowerPivot.
The link above is broken
Hi. This has really taken my interest.. I have huge data tables to work with...and I use vlookup to fetch certain data. I have different data in different sheets...
Like customer sales (customer code, product code,qty, piece rate, total amount, branch code) data in one sheet
Branch details in another (branch code, branch address, state , region)
Customer Geographical Data in third sheet (region, region name)
Product details in fourth sheet (product code, product description and related)
Now I use a vlookup to get branch name, state and product name respectively into my main sheet.
Now what I want is
customer code, product code,qty, piece rate, total amount, branch code) data in one sheet, branch address, state , region, region name, product description
Can't his be done thru data model... I tried but it's not working... Eitherway, I will gonthru thr session on e again and give a try... Any help, is appreciated. Thankyou
Dear All,
i am striving to do reverse relationship in Power pivot ,
example : -
1 - Data sheet
2. - Source data
step to stops - import first data sheet in power piovt and then source data , made relationship with both sheet , after created relationship i am able to do put related formula in source data sheet only (=releted('Source data'[Amount]), if i go to put formula in data sheet , parameter of Source data are not visible ,
could someone educate me how can i do , and utilize related formula in data sheet.