The swing from Party A to Party B or vice versa, between elections 1 and 2,
is the average of Party A's % gain (or loss) and Party B's % loss (or gain).
(A2 - A1) + (B1 - B2) Swing = —————————— 2
where A2 is the %vote for Party A in election 2 (most recent election), A1 is the %vote for Party A in election 1,
and similarly for Party B.
This is the conventional measure of swing developed by David Butler and originally used to measure the swing between the Conservative and Labour Parties, though in principle any two parties can be used. The usual practice is to put the Conservatives as Party A and Labour as Party B, so the result is that a positive swing represents a swing to the Conservatives while a negative swing represents a swing to Labour. The percentages are calculated on the basis of the total votes cast in the constituency, including parties that are not involved in the swing calculation.
Michael Steed produced a variant of conventional swing. He used the same basic concept but when calculating the percentage vote he based it on the total of the two party vote, excluding the votes for all the other parties.