How is the easier. variableName := variableName + addsomething.
The something might be a SUM, Count, DistinctCount, or a field value from a data table.
When, is more complex. Depends on what you are doing. In your case, you are trying to get a number from a Group Footer to appear in a later group footer or report footer, so I would add the appropriate value that you will need for the calculation in the group footer formula...I would update my shared variable(s) that I will need later from the values in the formula for the group footer (which is working).
Why in that formula? Several reasons: 1) we know that it is working 2) It 'knows' what the values are as they may not be reproducable by other means, 3) It's easy--kind of like 2, why take the time to recalculate what has already been calculated.
What you are adding/keeping track of is up to you. You know the report and the values, but when you need to use the values, they are available. Just put the formula that zeros out the variable in the header of the group that displays them/their final calculations.
Hope this helps