If you're new to calculated fields, you may find it helpful to review sample scenarios.
Related Topics:
Calculated Field Scenarios
The Calculated Fields form includes two options,
Perform Calculation On and
Sum Up Calculated Amounts on Total Lines, which you can combine to generate any of several scenarios.