The group league tables are ranked as the results are entered. As soon as a groups fixtures have been completed, the knockout schedule is created. The quarters, semi-final and final fixtures are then calculated as these results are entered.

The spreadsheet is unlocked so you are free to check out the formulas and how it all works. Download the Euro 2016 planner spreadsheet.

There are many formulas and techniques used to create this Euro 2016 planner. They include;

**The SUMPRODUCT function** – This has been used heavily to perform the calculations at the group stages. I thought it was the best function to handle the calculation of a team’s games played, number of wins, goals scored etc. Learn more about the SUMPRODUCT function.

**Ranking and then calculating unique ranking** – The rankings for the group stages are done on the *Calculations* sheet (you will need to unhide it). On here I needed to calculate a teams ranking based on points, then goal difference and then goals scored. If a ranking was still tied, a unique ranking was formulated.

**Nested IF’s** – These have been used in the knockout stages to organise the fixtures as the results are entered.

**The VLOOKUP function** – It was guaranteed to be used somewhere. It has been used on the *League Tables* sheet (another hidden sheet) to formulate the group tables from the workings on the *Calculations* sheet. It is also used to help calculate the third place teams permutations (explained later in this post). Learn more about VLOOKUP.

**The Excel Camera tool** – A brilliant little tool. Used to create a dynamic picture of the group tables from the *League Tables* sheet onto the *Group Stages* sheet. Find out more about the Excel Camera tool.

These skills and techniques are all shown in detail in my online course for creating your own sports league tables and tournaments in Excel. Join hundreds of others in learning these skills. I will be on hand to help with any queries.

The UEFA European Championships 2016 has a new format for some of the fixtures in the last 16 (the first knockout round). The top 2 teams in each of the 6 groups are automatically through. They are then followed by the 4 best third place finishers.

A ranking is given to each of the teams who finish third in their group. The four best teams’ progress. Who they play in the next round is determined by the table below.

For example, the table above shows that if the 4 best third place teams are from groups A, B, C and D, then the winner of group A would play the third best team in group C. But if the 4 best third place teams are from groups A, B, D and E, then the winner of group A would play the third best team in group D.

This made things a little complicated to calculate which team progresses and who they will play in the last 16. On the *League Tables* sheet you can see a league table for the third place teams. The four best groups are calculated and the table below is formulated.

On the *Knockout Stages* sheet a VLOOKUP function is then used to return the correct team from this table.

This article looks at 4 advanced techniques for summing values including;

- Summing a range that contains errors
- Creating a cumulative total
- A consolidated sum from multiple sheets
- Summing Every Nth Value in a Range

If the range of values you wish to sum contain an error, your SUM function will also return an error.

The AGGREGATE function released in Excel 2010 enables you to ignore error values when summing.

This function is very versatile and can also be used to calculate other aggregates such as the count, average or max values in a range. As well as ignoring errors, it can also be used to ignore hidden rows and subtotals in a range.

The image below shows the AGGREGATE function being used to sum a range of cells containing error values. In the formula, the number 9 specifies the use of Sum, and the number 6 specifies to ignore error values only.

View the video below for a complete explanation of the AGGREGATE function.

You may want to create a cumulative total, or running total, on your spreadsheet to add the values onto the previous value.

This cumulative total can be created with a simple formula as shown below.

This image shows a running total for the months of the year. The formula starts in cell C3 and has been exposed in the image to show its inner makings. This formula has been copied to cells C4:C13.

You may have values on multiple sheets that need summing. For example, these sheets may represent different months of the year, different regions or maybe different promotions that are running.

Let’s imagine the cell containing the value is in the same position on each sheet. For example, in cell B10. And the sheets you are using are grouped together and not separated by any other sheets.

You can write a SUM function to consolidate all of these values by;

- Begin typing the formula
*=SUM(* - Click on the first sheet of the range of sheets you want to use.
- Hold the Shift key on the keyboard and click on the last sheet in the range.
- Click on the cell containing the value one each sheet.

The end result will be something like below. In this example, *January* is the first sheet and *December* in the last sheet in the range.

=SUM(January:December!B4)

You could also just type this formula rather than follow the steps listed above.

It could be that the values you wish to sum are not in consecutive cells. Take the image below for instance where the values to be added are in every 5^{th} cell.

For this complex task we need the SUMPRODUCT function. This powerful function can handle complex criteria when adding or counting values (learn more about the SUMPRODUCT function).

The formula below is used to sum the values from every 5^{th} cell as in the example above.

=SUMPRODUCT((MOD(ROW($B$3:$B$22)-2,5)=0)*($B$3:$B$22))

The ROW function is used to return the row number of the current value. 2 is subtracted from this row number because in this example the list starts from row 3, so the 5^{th} row is row 7. So the value to add is always 2 cells above the multiples of 5 (5, 10, 15, 20).

The MOD function is used to divide the row number by 5 to determine if it is the 5^{th} cell. MOD will result in 0 if it is the 5^{th} row so SUMPRODUCT tests if it is equal to 0.

SUMPRODUCT then multiplies the result (which will be 1 if true) with the list of values. This is then totalled.

This is a complex formula so for a more complete understanding watch the video below.

]]>This post looks at using a formula to calculate this distinct count.

Consider the list below of a list of delegates attending our courses. A normal count on this range will tell us how many attendances there were. That’s good, but we want to know how many unique attendees there were.

If you have not been introduced to the amazing world of the SUMPRODUCT function before then you are in for a treat. This function comes to our rescue on so many occasions.

The image below shows the formula to count the number of different delegates that attended.

The answer appears as 4. There are 4 different delegates (Mickey Mouse, Bill Ding, Belle Jinwaffles and Minnie Mouse).

**Explanation**

Ok, let’s try and explain what is going on here.

The COUNTIF function produces the result below;

{3;2;1;3;1;3;2}

This is because Bill Ding appears 3 times, Belle Jinwaffles twice, then Mickey Mouse once etc. So it is counting how many times each different delegate attended.

These figures are then divided by 1 so that when summed together we are adding 1 for each delegate. The array below is summed.

{0.33;0.5;1;0.33;1;0.33;0.5}

Not the easiest formula to get your head around. Most importantly it works. An understanding can come with time if it seems tricky right now.

Spaces in the range will cause the *#DIV/0!* error to appear.

The formula can be adapted to ignore any spaces in the range.

]]>The spreadsheet below contains totals in every fifth row starting from row 3. We want to only add these sales totals.

The formula below is entered in cell E1.

Let’s break the formula down a little.

**ROW**: The ROW function is used to return the row number that the formula is checking. -2 has been entered on the end because the values begin from row 3. This -2 ensures that instead of using rows 7, 12, 17 and 22. Rows 5, 10, 15 and 20 are used.

**MOD**: The MOD function used to find the remainder after a number is divided by a divisor. It is used in this formula to check whether it is the fifth row or not. If it is the fifth row, after dividing the row number by five, the result will be 0.

Note: The MOD Function used in Excel VBA to check if a number is even.

**SUMPRODUCT**: The SUMPRODUCT function will perform the summing. The first array is the test for the row. This is what is returned;

{0;0;0;0;1;0;0;0;0;1;0;0;0;0;1;0;0;0;0;1}

The 1 is returned when the condition is true. This is multiplied by the range of values and then summed which gives us our total.

Note: See the SUMPRODUCT function used to count values based on multiple conditions.

I hope this explanation makes sense and you are able to adapt it for your own situation. If not, please check out this video.

Sum Every Nth Row in a List – Microsoft Excel Tips and Tricks

The SUMPRODUCT function is used to multiply the values of multiple arrays and then sum the totals. However it is capable of so much more amazing feats. It truly is one of those hidden gems waiting to be discovered.

In this example the SUMPRODUCT function is being used to count the number of orders in the list shown below.

This list has been formatted as a table providing many benefits. One of the benefits is the ease of referencing the necessary columns within a formula (Find out more about tables in Excel).

To use the SUMPRODUCT function to count records we will enter it as below.

=SUMPRODUCT((condition 1)*(condition 2)*(condition 3))

Each condition, or array, is enclosed within its own set of brackets. The multiplication operator (*) is used to apply the AND logic between each condition.

For example, the formula below will count all the orders by the salesperson Peacock (J9), and for the product Tofu (K9).

An area where SUMPRODUCT demonstrates its flexibility over alternatives such as COUNTIFS, is its ability to handle OR logic between conditions.

If we want to count all the orders by the salesperson Peacock (J9), and also the Salesperson Taylor (J10) we could enter the formula below. The Plus operator (+) has been used to create the OR logic between conditions.

The SUMPRODUCT function can handle many more conditions if necessary. When you get to grips with it you will feel like no data analysis is out of your reach.

This required matching records from different worksheets using multiple conditions. To check if they were a duplicate, the first name, last name and company fields needed to match.

To achieve this I wrote an array formula using the IF and SUMPRODUCT functions. This can be seen below testing the data from columns A, B and C across both sheets.

{=IF(SUMPRODUCT(((Sheet1!$A$2:$A$16000)=A2)*((Sheet1!$B$2:$B$16000)=B2)*((Sheet1!$C$2:$C$16000)=C2))=1,”Yes”,””)}

An array formula has curly braces at the ends which are added when you press Ctrl + Shift and Enter to run the formula.

The SUMPRODUCT formula returns true if you all three conditions match. THE IF function then displays the word Yes if there is a match on a record, and nothing if there is no match.

The column than then be filtered by blank cells to return all the missing records.

Find out more about the SUMPRODUCT function.

How would you have solved this problem? Drop me a comment with other formulas that could have achieved the same result.

]]>