Posted by Dave on

Analysing the 2015 General Election

Analysing the 2015 General Election

I am fed up hearing about the PLP’s 9m votes mandate. A large number of these 9m votes will have voted for Labour candidates that lost. So I decided to calculate the number of votes cast for the PLP. So something for both political geeks and excel nerds. Here’s how I did it.

First I obtained a results file from the Electoral Commission. There is no good reason to cache this, and many bad ones. Their URL is

There is a risk that they’ll remove the link but I’ll solve that problem another day. The tab, helpfully named ‘Results for analysis’, is what we need. The Constituency meta data is in columns a-i, column j is blank, and columns k -eq hold the party results. I have inserted anew column at column k, so the results are held in L – ER.

  1. New Column J, =MAX(L2:ER2), displays the winning result, which I called Winner
  2. New Column K, =INDIRECT(ADDRESS(1,SUMPRODUCT((L2:ER2=[@Winner])*(COLUMN(L2:ER2))))), for the non title first row where @Winner is J2, see above, which I called winning party. The ADDRESS function returns row 1, i.e. the column title cell, of the column containing the max  votes. INDIRECT resolves the value of the column header. See here… for advice on using the address function for this purpose, and here… for advice on the indirect fucntion.

See the image below, which illustrates the analysis.



I can now make a pivot table using the winning party and the sum of the winning votes aka winner, remembering to add Labour and the Co-Op votes.

Comments ( 3 )

  1. The PLP’s mandate | Well Red
    […] analysis is based on the electoral commission data, my methodology or technique is described here, a treat for excel nerds and does not include the bye-election […]
  2. Mandate – breadcrumbs of my mind
    […] I am fed up hearing about the PLP’s 9m vote mandate. Firstly, the total labour vote is ~8.7m. Secondly just above 5m voted for winning candidates i.e.the members of the PLP, the other 3.7m voted for Labour candidates that lost and thirdly, they won because they were Labour candidates, and that is chosen by the Party membership. Read More …. […]
  3. Visualising electoral data again |
    […] Analysing the 2015 general election […]

This site uses Akismet to reduce spam. Learn how your comment data is processed.