# Create a weighted average

Suppose you need to create a weighted average in your model. For example, you might have different cost escalation rates for different types of cost, and want to calculate the average cost escalation for your project, based on the proportions of different costs.

The Openbox file at the end of this article shows an example of how to do this. The calculation has an input that is a cost escalation rate (a % for each period) and a weighting factor (a constant %, although you could make it different in each period). Both have an array applied, which is the list of cost types.

You then create a calculation that multiplies the rate by the weighting factor. This will be repeated for each element of the array. Then a final calculation that adds up all the multiplied values to get the weighted average.

Have a look in the preview for the attached to see how the formulas look in a spreadsheet.