Calculate Cumulated Values: Year-to-Date
A demand planner is analyzing various scenarios with respect to the inventory levels resulting from different sales volumes. In a pessimistic scenario, actual sales are less than the forecast, and inventory starts piling up because actual sales are less than production, which is based on the forecast. This macro uses the difference between the forecast and a pessimistic sales estimate (contained in row 2) in order to calculate cumulative inventory levels at the end of every period, and writes the results to row 1. Having seen these worst-case inventory levels, the demand planner may adjust the forecast figures, also taking into account the inventory policy of the company, warehouse capacities, and so on.