The value of your holding on the day that you exchange is what matters. 39999.95 and you don't have to pay the 3%, 40000.05 and you do.
Sorry, that was ambiguous.
It's the value of your holding of your *existing* property on the day you exchange on your *second* property. In simple terms it's the value today, not when you bought.
And I don't see how an excel spreadsheet can avoid CGT. I don't really understand quite what your setup is but if a beneficial interest changes hands then there is potential for both CGT and SDLT.
I think you're saying this: (example)
Two people bought house for 48K and put in 10K and 40K (extra 2K is for legal fees) so your spreadsheet says 20% person 1 and 80% person 2.
Person 1 then pays 5K for a new boiler. spreadsheet now says 15K and 40K - so now person 1 owns 27.27% and person 2 now owns 72.73%.
That seems to me as though person 1 has bought 7.27% from person 2 for 5K. I think this will count as a market value transaction so person 2 is potentially liable for disposal of a 7.27% share to cgt. I guess SDLT would be out of scope as the consideration is small.
If the actual proportions changing hands are small enough then in reality then I guess it will fall inside the CGT allowance provided there are no other gains to worry elsewhere.
I'm pretty sure the law requires transfers of beneficial interest to be in writing. I'm not sure your excel spreadsheet would qualify - it would be the documentation that backs up the numbers in the spreadsheet that would matter. If HMRC decide to query your valuation of your share they're going to want to see all of that. On the one hand that might help you as, in law, you might still only own a beneficial interest in around 1% (3/380) but if you now think you should own 35/380 then you've lost out on all that money you've put in. On the plus side, if you sort it out after you exchange on your new property then it feels as though you'll avoid the 3% charge, but you'll have to worry about SDLT and CGT on getting your other 32% transferred.
Unfortunately, I think your position crosses a line where you need expert legal *and* accountancy advice to untangle. I can provide neither.