# Weighted average calculator

A weighted average is the average of a set of values, with each value having a different weight. It is calculated by multiplying each value by its weight, summing the products, and dividing by the total weight.

Here are the steps to calculate the weighted average:

1. Determine the values and their respective weights: Let’s say you have a set of values {v1, v2, …, vn} with corresponding weights {w1, w2, …, wn}.
2. Multiply each value by its weight: Calculate the products of each value with its weight, which gives you {v1w1, v2w2, …, vn*wn}.
3. Sum the products: Add all the products calculated in step 2. This gives you the sum of products, denoted as S.

S = v1w1 + v2w2 + … + vn*wn

4. Sum the weights: Add up all the weights, denoted as W.

W = w1 + w2 + … + wn

5. Divide the sum of products by the sum of weights: Calculate the quotient of S divided by W. This gives you the weighted average.

Weighted Average = S / W

For example, let’s say you have three test scores with corresponding weights:

• Test 1 score: 80, weight: 20%
• Test 2 score: 90, weight: 30%
• Test 3 score: 85, weight: 50%

To find the weighted average of these test scores, you would use the following formula:

Weighted Average = (800.2) + (900.3) + (85*0.5) / (0.2+0.3+0.5)

Weighted Average = 83.5

Therefore, the weighted average of the three test scores is 83.5.