A few years ago, I derived the formula that one would follow to wind up with a certain amount of sugar and a certain amount of alcohol (given a must of a particular starting sugar leveland a forifying liquor with a given ABV). You can read the backstory on it here:
Whole grape port .
You may have to go back a few posts to understand the problem we were solving. The basic question is: During the fermentation process, at what point do I add the fortifying liquor to wind up with a certain residual sugar level and a certain ABV?
Here is the calculation in all of its, ummm, glory:
I put this into an Excel sheet that I have attached here. There are two sheets: one you input the sugar in g/l, the other you input the SG of the must instead. In both sheets, you input parameters in the yellow boxes, and the answers come out in the blue boxes.