FLXCode Weighted Average Calculator

FLXCode apps

Appearance

Weighted Average Calculator

Paste a value column and a weight column. The weighted average and the arithmetic appear as you type.

One pair per line: the value, then its weight, like 90 40. Paste two columns from a spreadsheet. The weights can be percents or points.

Example Average

3.95455 Weighted average

Read 4 pairs.

The weights add up to 275, not 100 or 1. They are divided by their own sum, so the shares in the table add up to 100%.

Results
Pairs4
Sum of weights (Σw)275
Sum of value × weight (Σwx)1,087.5
Plain average, for comparison3.85

The steps, with your numbers

Multiply each value by its weight and add: Σwx = 4.2 × 120 + 3.6 × 80 + 4.5 × 45 + 3.1 × 30 = 1,087.5

Add the weights: Σw = 275

Divide: Σwx / Σw = 1,087.5 / 275 = 3.95455

Every pair: share of the weights and contribution

ValueWeightShare of weightValue × weight
4.212043.64%504
3.68029.09%288
4.54516.36%202.5
3.13010.91%93

No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.

Problem or idea? Email us

Quick start

  1. Paste two columns: the value first, its weight second. Or open an .xlsx or .csv file.
  2. Read the weighted average at the top. The table under it shows each pair's share of the weight and what it adds.
  3. Use Download .xlsx to get your numbers with the SUMPRODUCT formula already in place.

The formula

weighted average = Σ(value × weight) / Σ(weight)

Each value pulls on the answer in proportion to its weight. If all weights are equal you get the plain average.

Worked examples

CaseValues and weightsWeightedPlain
Survey score by group size4.2 for 120 people, 3.6 for 80, 4.5 for 45, 3.1 for 303.954553.85
Price paid per kg12.50 for 8 kg, 9.90 for 20 kg, 15 for 5 kg11.30312.4667
Course with category weights in percenthomework 88 at 30%, quiz 74 at 20%, exam 95 at 50%88.785.6667

In the price row you bought most of the cheap one, so the price per kg you really paid is 11.303, not the 12.4667 that a plain average of the three prices gives.

What counts as a weight

Anything non-negative: head counts, credit hours, kilograms, percents, points. Only the ratios matter, because the weights are divided by their own sum. If they do not add up to 100 or 1, the page says so and shows the shares as percent.

In Excel and Google Sheets

Type the values in A1:A4 (4.2, 3.6, 4.5, 3.1) and the weights in B1:B4 (120, 80, 45, 30). The formulas below work the same in both programs: every function name was checked against Google's function list.

TaskFormulaResult
Weighted average=SUMPRODUCT(A1:A4,B1:B4)/SUM(B1:B4)3.95455
Sum of the weights=SUM(B1:B4)275
Plain average, for comparison (ignores the weights)=AVERAGE(A1:A4)3.85

You can also paste the column into the box above, or open an .xlsx or .csv file with the Open button, and use Download .xlsx to get these formulas filled in with your own numbers.

Two things go wrong in a sheet. SUMPRODUCT does not skip rows hidden by a filter, so a filtered column still counts every row. And weights typed as percent (30%) are fine as they are, since the division by SUM(B1:B4) takes care of the scale. For stock lots see the stock average calculator.

Limits

Numbers this uses

  • Limit is 100,000 pairs per calculation. Kept low so the page stays quick on a phone.
  • Weights is zero or more, not all zero. A negative weight is refused with its pair named.
  • Files is .xlsx or .csv up to 25 MB, read in your browser. Old .xls files and password protected files are refused with a message.

This is plain arithmetic. For a course grade with a final exam use the grade calculator, for grade points and credits the GPA calculator, and for a list where every value counts the same, the average calculator. The mean, median and mode calculator shows the other kinds of middle.

Common mistakes

  • Averaging the averages of groups of different sizes. Use the group sizes as weights.
  • Putting the weight column first. The value goes first, the weight second.
  • Leaving a total row at the bottom. It counts as a pair, so remove it.

FAQ

How do I calculate a weighted average?

Multiply each value by its weight, add the products, and divide by the sum of the weights. For the survey example the products add up to 1,087.5 and the weights to 275, so the weighted average is 3.95455.

Do the weights have to add up to 100%?

No. The weights are divided by their own sum, so counts, credits, points and percents all work. Multiplying every weight by 7 gives the same answer: 3.95455 against 3.95455.

What is the weighted average formula in Excel or Google Sheets?

With values in A1:A4 and weights in B1:B4, type =SUMPRODUCT(A1:A4,B1:B4)/SUM(B1:B4). It works the same in both programs.

Why is AVERAGE wrong for weighted data?

AVERAGE counts every value once. In the survey example it gives 3.85, while the weighted average is 3.95455, because the biggest group scored higher.

Can a weight be zero or negative?

A zero weight is fine, that value just does not count. A negative weight is refused with the pair named. If every weight is zero there is nothing to divide by, and you get an error.

More from FLXCode

  • Average CalculatorAverage (mean) of pasted numbers, or a weighted average for grades and prices, with the steps.
  • Grade CalculatorWork out your course grade from weighted categories, and the score you need on the final to reach a goal.
  • GPA CalculatorWork out your semester, weighted and cumulative GPA from courses, credits and grades, or the grade you need for a goal.
  • Stock Average CalculatorAverage cost per share from several purchases, with optional total fees. Arithmetic only.

Share Weighted Average Calculator