Hello all

I am preparing an excel spreadsheet for the upcoming EURO 2012 tournament in the summer.
The tournament starts with a group stage, in which each group has 4 teams that play each other once.
At the end of the group stage, after each team has played 3 matches, if the number of points achieved by two teams or more is the same, the team that faired best against the other team(s) is the one that qualifies.
The simple ranking for this rule is easy- use RANK formula to rank according to number of points.
However, the second rule, which creates a sort of "mini-group" of two or three teams within the group, is more complex.
I know it can be done, but I have no idea how to do it.

Any ideas?

Thanks.