Political parties always face the challenge of appealing at the same time to older voters, and their teenage grandchildren. It's always a tricky assignment, and engaging a sometimes alienated youth vote has traditionally been regarded as the trickiest aspect of all. Now, however, Ipsos Mori has published analysis that suggests that – at least for the two biggest parties – the most pressing challenge is older people.

Ipsos Mori has analysed more than half a million interviews conducted over 17 years, and for the first time this untangles voters' age at whatever moment when they happen to have been polled, from what we call their "cohort" or generation – the era in which they were born. To understand the difference between a distinct cohort effect and a general age effect, compare medals for wartime service (which we associate with today's elderly, but only because of the particular years that their generation happens to have lived through) on the one hand, and reading glasses (a necessity for ageing eyes in every generation) on the other. We define four separate generations – prewar (those born before 1945), baby boomers (1945-65), Gen X (1966-1979) and Gen Y (1980-2000).

The conventional wisdom has it that the young vote left, while the old vote right, as the passionate radicalism of youth cools into conservative sentiment. That is not necessarily a problem for the right, since the ageing of the young will produce new older voters to replace those who die off. The position of the Conservatives, however, was for a long time something more frightening.

Between 1996 and around 2007 the Conservatives were heavily reliant not only on relatively older voters in general, but on the oldest prewar cohort in particular – raising the chilling prospect of their vote simply dying off. At the peak of the generational divide, those in the prewar cohort were three times more likely to vote Tory than Gen Y, and Gen X and baby boomers were also far less inclined to do so than those born before 1945.

Since then, however, the generational pattern of Conservative support has been transformed, and there is now only five percentage points between all age groups, from oldest to youngest. This might seem like very good news for the Tories – and at least some of it is. In particular, they have partly narrowed the gap by increasing their support among generation Y – mostly, it has to be said, before they came to power as part of the coalition. But since 2010 their support among the youngest has at least not slipped back, remarkable given data published last week about the battering that the finances of the young are taking in a recession, from which older people are proving to be much protected. The bad news, however, is that the age gap has also been closed by a loss of support among older age groups, including among that traditional prewar bedrock. If you were designing a way to close a generational gap, this wouldn't be it – not least because 76% of the oldest voters turned out in 2010, compared with 49% of the youngest.

Where the Tory vote used to be heavily age-stratified, for most of the years since the mid-90s Labour strength was consistent across the generations. Again, however, the most recent years brought a dramatic change. You might have thought that Labour would pick up where the Tories lost, and vice versa – but in fact changes for both parties moved in parallel. For Gen Y Labour, as well as the Tories, has in the last few years become a relatively more attractive option. But as with the Tories, Labour became less attractive to the oldest of all in the most recent data. In absolute terms, Labour's vote is still much stronger among the young than the Tories, but there is now little between the parties among the oldest.

All this raises two questions: where have the Gen Y voters who've flocked to the big two parties come from? And where did the old voters go?

First, Gen Y has turned sharply against the Liberal Democrats. As Cleggmania gave way to coalition and college fees, the youth vote for the Lib Dems halved. Second, we need to be careful with that phrase "youth vote". Gen Y are starting to grow up – and make up their minds. The proportion of them who are undecided has dived from roughly 30% to 20%.

If this story about the young is a standard "life-cycle" tale, the story among the elderly is anything but. The caricature pensioner is set in their ways, but the data is showing that great chunks of prewar voters are deserting both the traditional political tribes. Why? Ukip is part of the answer, a relatively new option that comes laced with nostalgic appeal. The oldest voters are five times more likely to lend their support to Nigel Farage than the youngest. The other part of the answer, however, is the old going the traditional way of the young – and playing hard to get. In recent months, we've seen a great spike in elderly "undecideds" that has not been mirrored in other generations.

When the two main parties have been bending over backwards to protect older voters from the worst of the cuts, this may seem churlish. But if the grey vote is becoming "the grey float" politicians will surely be even more desperate to woo them.