Exactly the same principle applies in your case as in the linked post about stock takes - you will still need to calculate the value of the materials and work in progress in your excel sheet at the end of each year exactly as you have been doing so far. Once you have that value then you would make a journal at year end moving the previous year’s year end value from credit stock to debit opening stock, and this year’s value credit closing stock and debit stock. Anything you buy during the year (“B” in your previous calculation) you would have recorded as general purchases when you bought it, so your year end P&L will show the same start+purchased-end calculation you’re used to.
Note that for this to work out, at the point where you first started using QuickFile you’ll need to have imported the previous year’s closing “C” value under “stock” in your opening trial balance.