You need to go back 7 years to calculate your full carry forward as the last of the 3 years includes any carry from the 3 years before it.
Also 2015 had a double allowance due.
HMRC has a carry forward calculator and don’t forget the minefield of tapering if it applies.
Do you have a source for that as it is contrary to anything I've ever seen on the subject - eg from the pensions advisory service:
"If a particular tax year’s unused annual allowance is not fully used, it can only be carried forward for up to three years, after which it is lost. "
2015/16 had a kind of double allowance for current inputs due to the alignment of PIPs eith tax year's , but no extra carry forward.
https://adviser.royallondon.com/technical-central/pensions/contributions-and-tax-relief/carry-forward-in-the-2015-16-transitional-year/
7 years is what the HMRC annual allowance calculator uses. The last of the 7 years only count to the last if the 3 most recent years
https://www.tax.service.gov.uk/pension-annual-allowance-calculator
That calculator is in serious need of some work! It cheerfully encourages you to put in loads of useless information then finishes by giving you an answer which is going to confuse many users.
On the plus side, it does actually correctly apply the rules which are that only unused allowance from the previous 3 tax years is available for carry forward. Any years before that are completely irrelevant. (I can only think that they leave them in the tool to let people work out if they paid too much into pensions in previous tax years). They then give the confusing message at the end that "In the tax year 6 April 2019 to 5 April 2020 you have £X of unused annual allowance and no tax to pay". What that actually means is that you have £x available for carry forward to future years. Your actual unused allowance is £x plus any unused allowance from 2016/17 if you want to make more contributions this year. You can see that in the table by looking at the unused allowance at the end of 2018/19.
All in all cua pretty bad piece of design.
I don't think the 3 years before are irrelevant. They carry foward to the last of the current 3 years so can still boost your annual allowance. Does anybody use an accountant they can ask?
I am a lapsed chartered accountant as it happens. Unfortunately what I can't do is work out how to paste an image from the HMRC calculator into this thread so I apologise for the dodgy formatting. In the below I plugged in contributions of £1k pa in all the early periods and then £34k, £35k and £36k for the last 3 tax years. As you will see all years before those three are completely ignored in the calculation of the available allowance of £55k for 2019/2020 - it's just the current £40k plus the £4k, £5k and £6k from the previous three.
Year Available annual allowance Available money purchase annual allowance Pension savings Amount on which tax is due Unused annual allowance
6 April 2019 to 5 April 2020 £55,000 £0 £40,000 £0 £9,000
6 April 2018 to 5 April 2019 £90,000 £0 £36,000 £0 £15,000
6 April 2017 to 5 April 2018 £124,000 £0 £35,000 £0 £50,000
6 April 2016 to 5 April 2017 £167,000 £0 £34,000 £0 £84,000
9 July 2015 to 5 April 2016 £177,000 £0 £1,000 £0 £127,000