As an analyst, I can vouch for the fact that the Test format offers the most nuanced and complex challenge of all. Any Test analysis is multilayered and the most obvious solution need not be the correct one. It turned out to be so in this exercise, which looks at Test cricket's greatest comebacks, with their spectrum of heroic and logic-defying feats.

The details of the methodology are in the sidebar. But here, to get us started, is a summary.

The analysis starts at the mid-point of each Test, i.e. right before the third innings commences. The computation of the index values is carried out before the start of the third and fourth innings and at the fall of a wicket in these innings. Thus, there are a maximum of 20 measuring points.

A notional target score is estimated for the third innings. This is a complex process since it relates to setting up a potential fourth-innings target. The target for the fourth innings is, of course, known.

At each measuring point, a projection is done based on the team score, historic data, and the first two/three innings scores.

Using the target and the projected scores, a WinIndex value is determined for the winning team.

Target determination Third-innings targets Difference over 200 runs A follow-on is treated differently to a non-follow-on situation. For eg: Australia 445 and India 171 means that India batted again after the Australian bowlers had bowled 60 overs. The bowlers were tired and India could exploit this to work towards a fourth-innings target of 250. The third-innings target was 524. Sri Lanka 600 and India 223 means that the deficit was 377. India could only think of going for a lower target of 200. The third-innings target was 577. England 284 and South Africa 521 means that England batted again after bowling 195 overs, and the South African bowlers were fresh. Therefore England have been given a fourth-innings target of 200. The third-innings score target was 437. Differing targets such as 200 and 250 are used in order to differentiate between 245-run and 377-run leads and to allow for the freshness of bowlers. Difference below 200 runs There is no difference whether the third batting team has the lead or is in deficit. Sequences of 130/110 or 450/500 should not lead to similar pre-determined targets. The average Runs per Wicket (RpW) for the combined first-innings scores (limited between 10 and 40) is multiplied by 10, 11 or 12 to determine the target. Differing multiplying factors are used so that varying RpW values are treated differently. At an RpW of 13, the team should aim for something more, in this case, 20%. At 38, they can, at best, aim for the full innings score. Freak pitches, which led to real-life scorelines of 75/123/475 or 523/598/173, should be ignored. Fourth-innings targets After the complexities of the third-innings targets, this is a piece of cake since the targets are set in stone and could range from 1 to 836. Determination of winning chances The winning chances are always determined for the batting team since the targets are available only for the batting team. In this article, the WinIndex values pertain to the ultimate winning team. Since each winning team has a batting and bowling innings, the required transformation is done for the bowling innings. The winning chances are determined ten times during each of the third and fourth innings - at the start of the innings and the at the fall of each wicket - leading to a maximum of 20 values.

Let me define the qualifying Tests. I will consider all decisive Tests that went into the fourth innings, including India v West Indies in Bridgetown 1982-83, which had a single no-ball in the fourth innings. As of October 2017, at the completion of the series-clinching win for Sri Lanka over Pakistan, 1132 Tests qualify. Incidentally, this last Test threatened to push itself into serious consideration until Sarfraz Ahmed decided to sweep from the rough. The South Africa v England Test in Centurion in 1999-00 and the England v Pakistan Test at The Oval in 2006 are not considered, for the obvious reasons of contrived declarations and forfeit.

Using the WinIndex pattern across the 20 measuring points, I made a shortlist of around 25 Tests. Then I scrutinised each match and completed the final selection of 13. I have tried to accommodate all eras of Test cricket and represent most of the top teams. There is a pleasant surprise at the end. In general, I looked for Tests that have a WinIndex pattern of at least 3-17. This was to ensure that only matches in which the winning teams came back from desperate situations are considered. There are some exceptions, which are explained later.

In the history of Test cricket there is just one Test with a WinIndex pattern of 0-20: that means that the winning team had no chance from the beginning of the third innings through the 19 fall-of-wicket instances. This was when unfancied South Africa stole a magnificent one-wicket over England in Johannesburg in 1905-06. Needless to say, this was an automatic entry into the final selection.

There are six Tests with patterns of 1-19, and three of them were selected. Also slotting in was the famous Neil Harvey-inspired win in Durban in 1949-50, which had a pattern of 1-15.

Three Tests were selected outside these set criteria. The one-run win by West Indies over Australia in Adelaide in 1992-93 could not be denied its place. It was poetic justice that the WinIndex equation was a beautiful 10-10.

I did some soul-searching while selecting a Test for India. I am strong in my belief that the greatest Indian come-from-behind win was neither Kolkata 2001 nor The Oval 1971, but Melbourne 1981. Kolkata was 13-5 in India's favour (Australia ahead only at the beginning, and till the fall of the first four wickets of India's second innings). The Oval was 14-3 in India's favour. Melbourne was 4-16 and gets in on merit.

Another selection that required some discretion was in selecting a Sri Lankan win from the abyss. The classic in Galle in 2015 featuring star performances from Dinesh Chandimal and Rangana Herath got the edge over the chase of 326 at the SSC in 1998 that was led by Aravinda de Silva. The Galle match clocks in at 4-16 while the SSC win was at 1-15. The final tilting of the scales here was the strength of the Indian team.

These, then, are the final selections, presented chronologically. The chasing wins are in green graphs and the defending ones in blue. The WinIndex percentage is shown on the Y-Axis and the Innings-Wicket on the X-Axis. The values run from 5 to 95.

1. Australia v England in Sydney, 1894-95

England won by ten runs

© Ananth Narayanan

That was the first-ever Test win after a follow-on. England's notional target as they batted in the third innings was 511(250+261). Albert Ward's hundred was supported by a number of useful innings, but at no stage did England look likely to reach the target. The final target for Australia was 176, somewhat below par. They were coasting at 130 for 2, and the WinIndex values remained below 40 for the first half of the innings. Then came a horrific collapse, from 158 for 5 to 162 for 9. Only at the fall of the ninth wicket did England forge ahead: their only WinIndex value exceeding 50. The WinIndex distribution was 1-19.

2. England v Australia at The Oval, 1902

England won by one wicket

© Ananth Narayanan

Australia batted efficiently for a first-innings score of 324. Hugh Trumble then dismissed the strong English line-up for 183. The lead of 141 meant that Australia's notional third-innings target was 163 (12*25.3-141). They could only score 121, yet the final target of 263 was quite stiff, seeing how England had floundered against Trumble and Jack Saunders, who now ripped through the top order to reduce Australia to 48 for 5. That is when the "Croucher", Gilbert Jessop, walked in to play an innings fit to be ranked among the best chasing innings ever. He added over a hundred with Stanley Jackson and 30 with George Hirst and was dismissed at 187 for 7. The match was in the balance, but clearly heading Australia's way. The ninth wicket fell at 248, and who will ever know whether Wilfred Rhodes told Hirst "Let's get' em in singles" or "Let us have a bash" or "Give 'em boogers, hell" or whatever else. They got those 15 runs and England won a memorable Test, against all odds.

3. South Africa v England in Johannesburg, 1905-06

South Africa won by one wicket

© Ananth Narayanan

This is the only Test match in which the winning team did not have a single WinIndex value exceeding 50: in other words, the only 0-20 in the history of Test cricket. A somewhat depleted English team was dismissed for 184 by a raw South African side. South Africa's inexperience was revealed when they did not even reach half that. The two low scores and the big lead meant that the notional third-innings target was just 72 (12*13.75-93), but England scored an impressive 190. Chasing 284, the Windex value for South Africa was 25% when they slumped to 105 for 6 and Dave Nourse played one of history's great match-winning innings, adding over 100 with Gordon White. At 226 for 7, the WinIndex was 49%. Then South Africa lost two quick wickets and were struggling at 239 for 9, but Nourse calmly added the required 48 runs with Percy Sherwell and won the match.

4. South Africa v Australia in Durban, 1949-50

Australia won by five wickets

© Ananth Narayanan

If I ever create a list of the five best Tests of all time, the Durban classic of 1950 would find a place. Eric Rowan anchored a potentially match-winning total of 311 against a potent Australian bowling attack. Australia floundered against the spin wizardry of Hugh Tayfield and were dismissed for 75, conceding a lead of 236. The fourth-innings target for Australia, 232 (12*19.3), was already contained in the lead, and the actual innings target was a notional one (48). This meant that even though South Africa were dismissed for 99, Australia was firmly stuck at WinIndex values either side of 30% for the entire third innings. The target of 336 felt like a mirage, and as they slipped to 59 for 3 and 95 for 4, the WinIndex value dipped below 30. Then Neil Harvey made 151 not out, a masterpiece fit to be ranked with the 153 not out nearly 50 years later by that other elegant left-hander, Brian Lara. Harvey added over a hundred with Sam Loxton, and then Colin McCool provided mature support as Australia romped home to a completely unexpected win. The WinIndex tally was 1-15.

5. Australia v India in Melbourne, 1980-81

India won by 59 runs

© Ananth Narayanan

I have already expressed my views on this win. India had a poor start but recovered through a masterly 114 by Gundappa Viswanath. However, 237 was a poor return on the first day of a Test and Allan Border's measured 124, assisted by support from Greg Chappell, Doug Walters and Rod Marsh took Australia to a first-innings lead of 182. India's notional target for the third innings was 542 (11*32.8+182). There were useful contributions from the top five but the last five wickets fell for only 64 runs. India's winning chances at the start of the fourth innings were not even 30%: understandable, with Australia's target a measly 143. But Australia lost quick wickets. The first two went to Karsan Ghavri, who bowled just about slow-medium. Dilip Doshi chipped in with two and Kapil Dev polished off the rest. I would not have been surprised if the odds against an India win before the Australian innings were 500-1 (remember that Headingley 1981 was still six months away). The last four WinIndex values were above 50 and the final tally was 4-16. I am firm in my belief that this is the greatest Indian Test win ever.

6. England v Australia at Headingley, 1981

England won by 18 runs

© Ananth Narayanan

This is a match we normally run out of adjectives to describe. I have written about it many times but never do a copy-and-paste since I always try to get a new perspective. Australia posted a formidable total of 401, made at a pedestrian pace. The Australian pace trio was devastating and dismissed England for 174, a deficit of 227. Today, there would have been no follow-on, but the times were different and England were asked to bat again. The same story repeated itself and England were staring at an innings defeat at 135 for 7. The colossus, Ian Botham, was at the crease and Graham Dilley came in. They added 117 runs and avoided an innings defeat. Chris Old had a wise head on his shoulders and helped Botham add another 67. Bob Willis helped Botham add another 37. During the entire third innings, the target of 477 (250+227) was way out of reach and the WinIndex remained firmly south of 30%. What followed was stirring. Willis produced arguably the best bowling performance ever by an English fast bowler, and dismissed Australia for 111. At 75 for 8, England had the edge, as also at 110 for 9. The Botham and Willis show ended with the WinIndex tally at 2-18.

7. Sri Lanka v Australia at the SSC, 1992

Australia won by 16 runs

© Ananth Narayanan

Batting first, slumping to 124 for 7, recovering to 256, but still conceding a lead of nearly 300 runs, Australia's plight at the SSC in 1992 was miserable. Granted, these were the pre-Muralitharan days, but Sri Lanka boasted a good all-round bowling attack at home. Australia had a notional third-innings target of 491 (200+291). No one scored a hundred, but then no one scored below 10, and they built up to 471. The steady batting is reflected by the WinIndex line hovering around the 40+ mark for most of the Australian innings. However, the final target of 181 was below par, considering the high totals in the match. When Sri Lanka were 132 for 3, a win was theirs for the taking. Aravinda de Silva, with a 32-ball-37 under his belt, went for an ambitious hit and Border completed a magnificent boundary catch. That was it. Greg Matthews and Shane Warne ran through the next six batsmen for the addition of only 32 runs. Australia went on to complete one of their most satisfying wins and the legend of Warne was born. Only at 156 for 9 did Australia go past a WinIndex value of 50 and it was 1-19 at the end.

8. New Zealand v Pakistan in Hamilton, 1992-93

Pakistan won by 33 runs

© Ananth Narayanan

New Zealand has always been a tough cricketing country to visit. On the 1992-93 tour, Pakistan had the better side on paper, especially because Martin Crowe was not available. But they started awfully, losing three wickets for 12, and recovered partially to reach 216, through a masterclass of 92 by Javed Miandad. In response, Mark Greatbatch played a consolidating innings of 133 and helped New Zealand to a lead of 48. Pakistan's notional target for the third innings was 336 (12*24+48). They barely reached the halfway mark, and there was a single spark in the form of Inzamam-ul-Haq's 75. Through most of the innings, the WinIndex values for Pakistan remained around the 30 mark. The fourth-innings target of 127 was way below par. However, Wasim Akram and Waqar Younis, while not generally seeing eye to eye off the field, were arguably the most devastating bowling pair in Test history. Wasim bowled unchanged for 22 overs and Waqar 14, and together they dismissed New Zealand for 93. Only at the fall of the eighth wicket, at 88, did the tide really turn for Pakistan, so it was 2-18 in the WinIndex stakes.

9. Australia v West Indies in Adelaide, 1992-93

West Indies* won by one run

© Ananth Narayanan

A few days after the thriller at the SSC, Australia and West Indies played a magnificent Test in Adelaide: just one run away from being the perfect Test match. West Indies were sitting comfortably at 129 for 2, but could not even double that score, finishing on 252, a poor return for Adelaide. Curtly Ambrose was magnificent and ripped through the strong Australian batting, earning a lead of 39 with his 6 for 74. The notional third-innings target for West Indies was 240 (12*23.2-39). They folded for just 146, almost half of those runs scored by Richie Richardson. The WinIndex values moved either side of 50 through this innings. The target of 186 was a fair one. Australia's chase was a mix of the horrible and sublime: 16 for 2, 64 for 4 and 74 for 7 tell the story. Everything seemed over at 102 for 8. Tim May and a patient Warne added a few runs but the ninth wicket fell at 144. May, batting beautifully, had taken the score to 184 when Craig McDermott fell. The ultimate victory margin of a single run was most appropriate. Also appropriate is the WinIndex tally: a perfect 10-10.

10. Australia v South Africa in Sydney, 1993-94

South Africa won by five runs

© Ananth Narayanan

If you ask me which is the greatest couple of years in Test cricket, I will unhesitatingly say 1992 to 1994. Five of my 13 selections are from this period. The New Year Test at the SCG brought grief to the visiting South Africans on the opening day. Warne was almost unplayable and his haul of seven wickets meant that South Africa scored just 169. In response, Australia secured a potentially match-winning lead of 123. The notional target for South Africa in the third innings was 399 (12*22.7+123). They reached 239, thanks to a plucky 76 by Jonty Rhodes. The graph reveals the WinIndex values fluctuating around the 30 mark. The target of 117 foretold an easy win for Australia's strong batting line-up, but Fanie de Villiers had other ideas. He captured the first four wickets and then Allan Donald chipped in. Then, when McDermott seemed to be taking Australia to a memorable win, de Villiers came and picked up the last wicket to leave South Africa winners by five runs. Only at the fall of the eighth wicket did South Africa look like winning, which is reflected in the WinIndex tally of 1-19.

11. Pakistan v Australia in Karachi, 1994-95

Pakistan won by one wicket

© Ananth Narayanan

This is the fifth Test from our golden 26-month period. Solid middle-order batting helped Australia to a useful 337 in the first innings. Their pace-spin combination then combined to secure a lead of 81. Australia's notional target for the third innings was 274 (12*29.7-81). At 171 for 2, they were well on their way to an imposing total, mainly through David Boon's hundred. Then came a massive collapse, engineered by Wasim and Waqar, and Australia folded for 232, leaving Pakistan 314 to get in the last innings. The chase was well placed at 148 for 2, then floundering at 184 for 7, 236 for 8 and 258 for 9. Everything seemed lost for Pakistan when Mushtaq Ahmed walked in to join Inzamam. Slowly but surely the pair scored the 57 runs to win an extraordinary match by a single wicket, Mushtaq's attacking innings of 20 in 30 balls perhaps as responsible for the win as Inzamam's effort. The final WinIndex equation was 3-17.

12. Australia v Pakistan in Hobart, 1999-2000

Australia won by four wickets

© Ananth Narayanan

Another amazing Test match featuring Australia. This one in from the early stages of their 16-Test winning streak. This is also the Test that almost upset the applecart. The two first innings were similar: both below par, and Australia ended with a slender lead of 24. Pakistan's notional third-innings target was 304 (12*23.4+24). They exceeded it comfortably, with 392, through Inzamam's hundred and fifties from Saeed Anwar and Ijaz Ahmed. The target of 369 and the loss of early wickets worsened the situation for Australia. At 126 for 5, everything seemed lost. Australia's WinIndex value dipped below 30. Justin Langer was joined by Adam Gilchrist, playing his second Test. They produced an extraordinary partnership of 238 and took Australia to within a few runs of the target. The Australian WinIndex value exceeded 50 for the second time at the fall of the sixth wicket. A magnificent chasing win.

13. Sri Lanka v India in Galle, 2015

Sri Lanka won by 63 runs

© Ananth Narayanan

This is the only Test from the current millennium. Sri Lanka did not even reach 200 on the first day since they could not fathom R Ashwin's bewildering mix of deliveries. Centuries from Shikhar Dhawan and Virat Kohli meant that India finished with a huge lead. Sri Lanka's notional target for the third innings was a massive 526 (12*27.9+192). That looked a pipe dream when they slumped to 5 for 3. Kumar Sangakkara and Angelo Mathews retrieved the situation partly but at 95 for 5, the abyss beckoned. Dinesh Chandimal then played an innings fit to be remembered alongside Sanath Jayasuriya's 253, Mahela Jayawardene's 180 and Kusal Mendis' 176. His run-a-ball 162 was a complete bolt from the blue. He added valuable runs with Lahiru Thirimanne and Jehan Mubarak, and the final total of 367 meant that India would have to chase 176. The momentum was with Sri Lanka and Rangana Herath was virtually unplayable. India folded for 112, leaving Sri Lanka winners by 63 runs and Herath with figures of 7 for 48. Only towards the end of the innings did Sri Lanka gain the ascendancy, and this resulted in a WinIndex distribution of 4-16.

Australia v West Indies in Brisbane, 1960-61

Match tied

© Ananth Narayanan

And finally, an extra atop the baker's dozen, a tribute to that most sublime and remarkable of Tests: the first tied Test. The first two innings were in excess of 450 and West Indies started the third innings in arrears by 52. Their notional target was 452. They were behind right through the innings and set Australia a final target of just 233. Only at 49 for 4, 57 for 5 and 92 for 6 in the final innings did West Indies forge ahead. They fell back again because of the huge seventh-wicket partnership between Alan Davidson and Richie Benaud. Australia were then firmly in the saddle until the fall of the tenth wicket. The final WinIndex distribution was 3-17, a terrific comeback result for West Indies.

The other matches in the shortlist are briefly enumerated below, in reverse chronological order.

India v England, Chennai, 2008-09. A successful last-day chase in Chennai after Kevin Pietersen's challenging declaration. The relatively easy win proved a stumbling block in the final selection.

India v Australia, Mumbai, 2004-05. A dead rubber played on an apology of a pitch. A close but thoroughly unsatisfactory Test.

West Indies v Australia, Antigua, 2003. Dead-heat first innings, followed by West Indies completing the biggest chase of all time.

Sri Lanka v South Africa, Kandy, 2000. South Africa's successful defence of 177 through unfancied bowlers like Lance Klusener and Nicky Boje.

West Indies v Australia, Barbados, 1998-99. Arguably the chasing innings to beat all others, Lara's 153 not out taking West Indies to a one-wicket win. However, the WinIndex count was 10-10.

Sri Lanka v Zimbawe, SSC, 1997-98. Sri Lanka chase down a huge target through a magnificent de Silva hundred. A 1-19 Test.

England v Australia, The Oval, 1997. Phil Tufnell and Andy Caddick defend a paltry target of 124 against a strong Australian batting line-up.

New Zealand v Pakistan, Christchurch, 1994-95. A tough chase masterminded by hundreds from Bryan Young and Shane Thomson.

England v Australia, Manchester, 1961. A spin masterclass by Benaud, who used the rough to dismiss England for 201 after they were 150 for 2.

England v Pakistan, The Oval, 1954. A magnificent match performance of 12 for 99 by Fazal Mahmood taking Pakistan to a 24-run win in a low-scoring Test. England had Hutton, May, Simpson, Compton, Graveney, Tyson and Statham in their ranks.

Australia v England, Manchester, 1902. Trumble and Saunders defending 124 with three runs to spare.

In addition to the five Tests between August 1992 and September 1994 in the final selection, there is a sixth from that period in the shortlist. Further, there is one other Test from the 1990s in the final selection and three more in the shortlist. The 1990s were truly the golden decade of Test cricket.

* The result was tweaked to indicate that it was West Indies and not Australia who won the Adelaide Test by one run

Anantha Narayanan has written for ESPNcricinfo and CastrolCricket and worked with a number of companies on their cricket performance ratings-related systems

© ESPN Sports Media Ltd.