I'll see if my memory holds.
You have, or can buy, gilts at a price X for each £100 par value.
You get a coupon B every 6 months. Can't be bothered working in 6 months if long dated so do it by year and so you get twice B lets call it C per year.
You will also get €100 back on maturity.
Lets say maturity is N years in the future.
So, assuming the alphabet doesn't run out of letters,
You need to find the value r, the rate of return, where
X = 100/(1+r)^N +C/(1+r)^N+ C/(1+r)^(N-1) +C/(1+r)^(N-2) ....and so on back to a year from now.
So return at par plus coupon in final year (but you may get only a half the annual coupon depending when it matures) plus coupon in next to last year plus....
Of course this doesn't exactly match niceties of dirty price when you buy or 6 monthly increments but should be close enough I would think.
Or
https://support.microsof...8-495b-b290-3ad0c163c1bc