To calculate an average, add all the values and divide the total by the number of values. The five numbers 12, 15, 15, 18 and 20 add up to 80, and 80 ÷ 5 = 16, so the average is 16. Statisticians call this the arithmetic mean; the median and mode are two other ways to describe a typical value.
What is the formula for the average?
average = (x₁ + x₂ + … + xₙ) ÷ n
- x₁ … xₙ are the individual values.
- n is how many values there are.
The NIST/SEMATECH e-Handbook of Statistical Methods defines the mean as the sum of the data points divided by the number of data points and notes that this is the value most commonly called the average. Statistics texts write it as x̄ ("x-bar") for a sample and μ for a whole population; the arithmetic is identical.
How do you calculate the average step by step?
- List every value. Check that all of them use the same unit.
- Add them to get the total.
- Count the values.
- Divide the total by the count.
Worked example: five weekly grocery bills of $82, $95, $78, $110 and $90.
- Total = 82 + 95 + 78 + 110 + 90 = 455
- Count = 5
- Average = 455 ÷ 5 = $91
A quick check: the result should sit between the smallest and the largest value (78 and 110). If it does not, an addition slipped.
What are the median and the mode?
The mean is only one kind of average. The three common ones answer slightly different questions.
| Measure | How to find it | Best for |
|---|---|---|
| Mean | Sum ÷ count | Roughly symmetric data, totals that matter |
| Median | Middle value of the sorted list | Data with extreme values |
| Mode | Most frequent value | Categories, "most common" questions |
How to find the median
Sort the values from smallest to largest. With an odd count, the median is the middle value. With an even count, it is the mean of the two middle values. OpenStax places the median at position (n + 1) ÷ 2 in the sorted list.
- Odd count: 3, 4, 5, 6, 8, 8, 9 has seven values, so the median is the 4th value, 6.
- Even count: 3, 5, 7, 10 has four values; the middle two are 5 and 7, so the median is (5 + 7) ÷ 2 = 6.
How to find the mode
The mode is the value that occurs most often. In 3, 4, 5, 6, 8, 8, 9 the value 8 appears twice and every other value once, so the mode is 8. A data set can have two modes (bimodal) or none that stand out, and NIST notes the mode is not necessarily unique. Unlike the other two, the mode also works for non-numeric data, such as the most common shoe size or the most popular answer in a survey.
For the same list, 3, 4, 5, 6, 8, 8, 9, the three measures are mean ≈ 6.14 (43 ÷ 7), median 6 and mode 8. The mean, median and mode calculator returns all three at once.
Which average should you use when there are outliers?
An outlier is a value far from the rest. The mean uses every value, so one extreme value pulls it toward itself. The median depends only on rank, so it barely moves. NIST states that extreme values in the tails distort the mean but not the median, and that for data with extreme values the median is a better estimate of location.
Worked example: monthly electricity bills, in dollars, for seven neighbouring flats: 42, 45, 47, 48, 50, 52 and 310 (the last flat runs a home workshop).
- Mean = (42 + 45 + 47 + 48 + 50 + 52 + 310) ÷ 7 = 594 ÷ 7 ≈ $84.86
- Median = 4th value of the sorted list = $48
Six of the seven flats pay between $42 and $52, so the median of $48 describes the typical bill, while the mean of about $84.86 describes nobody. OpenStax makes the same point with a small town where one resident earns $5,000,000 and 49 earn $30,000: the mean is $129,400 but the median is $30,000.
Reporting both numbers is often the honest choice. A large gap between the mean and the median is a sign that a few values are dominating the total.
How do you calculate a weighted average?
A weighted average is used when some values count more than others. Multiply each value by its weight, add the products, and divide by the sum of the weights. OpenStax Principles of Finance describes the same procedure: the sum of the value-times-weight column divided by the sum of the weights.
weighted average = Σ(value × weight) ÷ Σ(weights)
Worked example: a course counts homework 40%, a midterm 35% and a project 25%. The scores are 90, 80 and 70.
| Part | Score | Weight | Score × weight |
|---|---|---|---|
| Homework | 90 | 0.40 | 36.0 |
| Midterm | 80 | 0.35 | 28.0 |
| Project | 70 | 0.25 | 17.5 |
| Total | 1.00 | 81.5 |
The weights add to 1, so the weighted average is 81.5. A plain average of 90, 80 and 70 would give 80, which ignores that homework counts most. The guide to calculating your final grade applies this to the score needed on an exam, and the GPA guide applies it with credit hours as weights.
Why you should not average two averages directly
Suppose class A has 20 students with an average of 80, and class B has 5 students with an average of 60. Averaging 80 and 60 gives 70, but that treats the two classes as equal in size. The correct combined average weights each class by its size:
(20 × 80 + 5 × 60) ÷ 25 = 1,900 ÷ 25 = 76
The same rule applies to averages of percentages, prices, speeds and rates whenever the bases differ. For percentage questions, the guide to calculating a percentage shows how to find each part first.
How do you average values that repeat?
When values repeat, group them. Multiply each distinct value by its frequency, add the products and divide by the total count. OpenStax's example list 1, 1, 1, 2, 2, 3, 4, 4, 4, 4, 4 has 11 values that add to 30, so the mean is 30 ÷ 11 ≈ 2.73. Grouping gives the same answer: (1 × 3 + 2 × 2 + 3 × 1 + 4 × 5) ÷ 11 = 30 ÷ 11. Frequency tables in surveys use exactly this shortcut.
Common mistakes when calculating an average
- Dividing by the wrong count. Count the values rather than assuming the last row number is the count; a skipped or doubled entry changes the result.
- Mixing units. Convert everything to one unit before adding.
- Averaging averages without weighting by group size.
- Reporting only the mean for skewed data such as incomes or house prices.
- Averaging ratios such as percentages whose bases differ, as if each base were the same.
How do you spot a result that is wrong?
Three quick checks catch most errors. The mean must lie between the smallest and largest value. If all values are equal, the mean equals that value. Adding the same amount to every value raises the mean by exactly that amount, so shifting the data by a constant and re-averaging is a simple verification.