Mean, median or mode? How to choose a summary statistic
How to pick the center and spread that describe your data fairly, with worked numbers and a side-by-side of the quartile rules that different tools use.
Which average should you use?
Use the median when your numbers are skewed or include a few extreme values, as pay, home prices and waiting times usually do. Use the mean when the numbers are roughly symmetric, or when you need to get back to a total. Use the mode for categories such as brands or reasons, where it is the only one of the three that exists. Then report a measure of spread with it, because a center alone hides how far typical values stray from it.
| Your data | Center to report | Spread to pair with it |
|---|---|---|
| Numbers, roughly symmetric, no extreme values (test scores, repeated measurements) | Mean | Standard deviation |
| Numbers that are skewed or have a few extreme values (pay, prices, wait times) | Median | Interquartile range (Q1 to Q3) |
| Numbers where the total matters (payroll, spending per order) | Mean, with the median beside it if the data are skewed | Standard deviation or quartiles |
| Ordered categories (star ratings, survey scales) | Median, plus the share at each level | The share at each level |
| Unordered categories (brand, color, reason for a return) | Mode | Percentage in each category |
| Averages of groups of different sizes | Weighted mean | Spread of the individual values (group averages alone can’t give it) |
Q1 and Q3 are the first and third quartiles, the values a quarter and three-quarters of the way up the sorted data. The interquartile range (IQR) is Q3 − Q1, the span of the middle half.
If the values fall into two or more separate clusters, no single center describes them well. Summarize each cluster on its own.
When is the median better than the mean?
When a few values sit far from the rest. The mean uses the size of every value, so one extreme value can drag it a long way. The median depends only on which value sits in the middle of the sorted list.
Worked example (example data). Annual salaries at a 10-person business, owner included, in thousands of dollars:
38, 41, 44, 46, 48, 52, 55, 59, 64, 310
- Mean: the salaries total $757,000, and $757,000 ÷ 10 = $75,700.
- Median: with an even count, average the 5th and 6th sorted values: (48 + 52) ÷ 2 = 50, so $50,000.
- Reality check: nine of the ten people earn less than the “average” salary.
Here is what the owner’s salary does to each statistic:
| Statistic | With the $310,000 salary | Without the $310,000 salary |
|---|---|---|
| Mean | $75,700 | $49,667 |
| Median | $50,000 | $48,000 |
| Standard deviation (population) | $78,474 | $8,069 |
| Interquartile range (Excel QUARTILE.INC method) | $13,500 | $11,000 |
That one salary adds $26,033 to the mean but only $2,000 to the median. If the owner’s pay doubled to $620,000, the mean would rise to $106,700, while the median ($50,000) and the interquartile range ($13,500) would not move at all. For “what does a typical person here earn?”, the median is the fair answer.
When is the mean still the right number?
When you need a total, or when the data are close to symmetric. Only the mean converts back to a total (mean × count = total): this payroll costs $75,700 × 10 = $757,000, which the median can’t tell you. If the data are skewed and the total matters, report both. For roughly symmetric data the two land close together anyway. NIST’s handbook calls the mean the optimal estimator of the center when the data follow a normal distribution, and says the median gives the better estimate when extreme values sit in the tails.
How does skew affect the mean, median and mode?
Skew pulls the mean toward the long tail further than it pulls the median. With a long right tail (pay, home prices, repair times) you typically get mode < median < mean. With a long left tail, such as scores on an easy test, the order reverses. In a symmetric distribution with one peak, all three coincide.
The gap is a quick check. In the salary example the mean is $25,700 (51%) above the median, which tells you the data are lopsided before you draw a chart.
The textbook ordering is a tendency, not a law. Paul von Hippel found that it fails surprisingly often, most commonly in discrete data where a block of values tied at the median leaves unequal shares above and below it. Example data: the number of people living in each of 20 homes is 1 (8 homes), 2 (9 homes), and 3, 4 and 6 (one home each). The tail runs to the right (the skewness coefficient is about +2), and the median and mode are both 2. Yet the mean is 39 ÷ 20 = 1.95, below the median. The reason: 40% of the homes are below the median and only 15% above it; the other 45% sit exactly on it. Compute the statistics rather than inferring them from the shape.
When is the mode the only sensible choice?
When the data are categories with no natural order, such as the reason a product was returned or a favorite brand. You can’t add or sort them, so there is no mean or median; the mode, the most frequent category, is the only center. Give the percentage in each category too, because the most common answer can still be a minority. Excel’s MODE.SNGL ignores text cells, so count category labels with a pivot table or frequency table instead.
For measured numbers such as weights or times, exact repeats are rare. Group the values into ranges and use the midpoint of the tallest histogram bar, as NIST suggests.
Ordered categories such as star ratings can be sorted, so the median works. The mean assumes the steps between levels are equal, which the scale doesn’t promise: “good” to “excellent” need not be the same distance as “poor” to “fair”. Means of ratings are common anyway; just know what they assume.
Polarized ratings are where every single center misleads. Example data: 20 ratings on a 1–5 scale: six 1s, one 2, two 3s, three 4s and eight 5s. The mean is 3.3, which sounds lukewarm, yet only 2 of the 20 people chose 3. The median is 4 and the mode is 5, which sound positive, yet 35% gave a 1 or 2. What the data actually show is a split: 55% gave 4 or 5. For data like this, the breakdown is the summary.
Why do Excel, a TI-84 and Python give different quartiles?
Because “quartile” has no single agreed definition for a sample. Hyndman and Fan catalogued nine rules used by statistical software, and Langford counted at least a dozen across textbooks, software and calculators. The four rules you are most likely to meet all give the same median, but Q1 and Q3, and with them the IQR and the outlier fences (1.5 × IQR beyond Q1 and Q3), can differ. Applied to the salaries, in thousands of dollars:
| Method | Q1 | Q3 | IQR |
|---|---|---|---|
| Inclusive (type 7) | 44.5 | 58 | 13.5 |
| Exclusive (type 6) | 43.25 | 60.25 | 17 |
| Median of halves | 44 | 59 | 15 |
| Tukey’s hinges | 44 | 59 | 15 |
Where you’ll meet each:
- Inclusive: linear interpolation, Hyndman–Fan type 7. Excel QUARTILE.INC and QUARTILE, R
quantile()default, NumPypercentiledefault. - Exclusive: linear interpolation, type 6. Excel QUARTILE.EXC, Python
statistics.quantilesdefault, Minitab, SPSS. - Median of halves, median left out: TI-83 and TI-84 calculators, several introductory textbooks.
- Tukey’s hinges, median kept in each half: R
fivenum().
The difference is where each rule places Q1 in the sorted list. Positions count from 1, and p is 0.25 for Q1 and 0.75 for Q3:
- Inclusive: position , a quarter of the way from the 3rd value (44) to the 4th (46): 44 + 0.25 × 2 = 44.5.
- Exclusive: position , three-quarters of the way from the 2nd value (41) to the 3rd (44): 41 + 0.75 × 3 = 43.25.
- Median of halves: the lower half is 38, 41, 44, 46, 48, and its median is 44.
Q3 applies the same rules from the top: positions 7.75 and 8.25 give 58 and 60.25, and the upper half (52 to 310) has median 59.
Three patterns help when you reconcile tools:
- Odd counts give at most two answers. When n is odd, the inclusive rule matches Tukey’s hinges and the exclusive rule matches the median-of-halves rule, so Excel’s QUARTILE.EXC agrees with a TI-84. When n is even, you can get three different answers, as here.
- “Exclusive” means two things. Excel and Python use it for the (n + 1)p rule; other writers, Langford among them, use it for leaving the median out of the halves. They are guaranteed to agree only when n is odd.
- The rules are never more than half a position apart. With hundreds of values the answers are usually close. With ten salaries, the Q3 answers span $2,250.
Outlier flags inherit the disagreement. The upper fence, Q3 + 1.5 × IQR, is $78,250 by the inclusive rule, $81,500 by the median-of-halves rule and $85,750 by the exclusive rule. The $310,000 salary is flagged by all three, but a value near a fence can be an outlier in one tool and not in another. A flag is a prompt to check the data, not proof of an error.
None of these rules is wrong. Use the one your course, report or colleagues use, and name it whenever you publish quartiles or an IQR.
Which measure of spread goes with which average?
Pair the standard deviation with the mean, and the interquartile range with the median. The standard deviation squares each distance from the mean, which gives extreme values extra weight: the one high salary makes it almost 10 times larger. The IQR covers only the middle half of the data, so, like the median, it ignores how far out the extremes are.
In the salary data, mean ± one standard deviation is $75,700 ± $78,474, which reaches below zero (−$2,774), an impossible salary: a sign the mean-and-SD summary doesn’t fit. “Median $50,000, middle half between $44,500 and $58,000, plus one salary of $310,000” does.
The standard deviation here divides by n because the ten employees are the whole group ($78,474). For a sample from a larger group, divide by n − 1 instead ($82,719).
How do you average averages?
Weight each average by the size of its group. A plain mean of group averages treats a group of 12 like a group of 30.
Example data: three sections of a course report average scores of 81 (12 students), 74 (30 students) and 88 (18 students).
- Mean of the three averages: (81 + 74 + 88) ÷ 3 = 81.0.
- Average of all 60 students, weighting each section by its size: the weighted scores add up to 12 × 81 + 30 × 74 + 18 × 88 = 4,776, and the weights to 12 + 30 + 18 = 60.
The plain mean overstates the class by 1.4 points because the largest section scored lowest. The same fix applies to an average price across purchases of different sizes. Medians don’t combine like this: in general, three section medians can’t give you the median of all 60 students, so keep the raw scores if you will need it.
Try it
- Mean, median and mode calculator: paste
38, 41, 44, 46, 48, 52, 55, 59, 64, 310(salaries in thousands). Expect mean 75.7, median 50, no mode and, with the default quartile method, Linear (Excel QUARTILE.INC), Q1 = 44.5, Q3 = 58 and IQR = 13.5, with 310 flagged as a possible outlier. Its “Quartiles by method” table gives 44 and 59 for the median of halves (TI-84) and Tukey’s hinges, and 43.25 and 60.25 for the exclusive method (QUARTILE.EXC). Without 310: mean 49.6667 (the page shows four decimals), median 48. - Same calculator:
1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 6gives mean 1.95, median 2 and mode 2; the ratings1, 1, 1, 1, 1, 1, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5give mean 3.3, median 4 and mode 5. - Standard deviation calculator: paste the ten salaries, or press Staff salaries next to “Try:” to load them. Population (N) gives 78.47 and Sample (n − 1) gives 82.72; without 310, Population (N) gives 8.07.
- Weighted average calculator: set “Weights are” to Other numbers, since the weights are student counts, then enter the values 81, 74 and 88 with weights 12, 30 and 18. The weighted average is 79.6, next to a simple average of 81.
Questions
Should I remove an outlier before calculating the mean?
Only if it is a mistake, such as a typo or a value in the wrong units, or if it doesn’t belong to the group you are describing. A genuine value, like the owner’s salary in the salary example, is part of the data. Keep it and use a summary it can’t dominate, such as the median and interquartile range, or report the figures with and without it and say which is which.
Is “average” the same as the mean?
Usually. In everyday speech and in spreadsheet functions such as Excel’s AVERAGE, “average” means the arithmetic mean, the total divided by the count. Some writers use the word loosely for any center, and some reports on pay or prices give a median instead, so check which statistic a figure is before you compare it with your own.
Sources
- e-Handbook of Statistical Methods, 1.3.5.1 Measures of Location NIST/SEMATECH Definitions of mean, median and mode; the mean is pulled in the direction of the skew; the mean is the optimal estimator for normal data, while the median gives a better estimate when there are extreme values in the tails; for continuous data, the mode as the midpoint of the histogram interval with the highest peak.
- e-Handbook of Statistical Methods, 1.3.5.6 Measures of Scale NIST/SEMATECH Squaring distances gives extra weight to values far from the mean, so the variance and standard deviation can be greatly affected by the tails; the interquartile range uses only the middle portion of the data.
- Introductory Statistics 2e, 2.5 Measures of the Center of the Data OpenStax (Rice University) The median is generally better when there are outliers; “mean” and “average” are used interchangeably; the mode also applies to qualitative data.
- Introductory Statistics 2e, 2.6 Skewness and the Mean, Median, and Mode OpenStax (Rice University) In a perfectly symmetrical distribution the mean and median are equal, and a single mode equals them too; the mean reflects skew more than the median does.
- Introductory Statistics 2e, 2.3 Measures of the Location of the Data OpenStax (Rice University) Quartiles as the medians of the lower and upper halves, IQR = Q3 − Q1, and the 1.5 × IQR rule for potential outliers, which require further investigation.
- Introductory Statistics 2e, 1.3 Frequency, Frequency Tables, and Levels of Measurement OpenStax (Rice University) Nominal data have no order; ordinal data can be ordered but the differences between levels cannot be measured.
- Mean, Median, and Skew: Correcting a Textbook Rule (P. T. von Hippel, vol. 13, no. 2, 2005) Journal of Statistics Education (American Statistical Association) The rule that skew puts the mean beyond the median fails surprisingly often, most commonly in discrete distributions where the areas to the left and right of the median are unequal.
- Quartiles in Elementary Statistics (E. Langford, vol. 14, no. 3, 2006) Journal of Statistics Education (American Statistical Association) At least a dozen quartile methods across textbooks, software and calculators; Excel’s quartile routine is Hyndman–Fan method 7; the TI-83 Plus, TI-84 Plus and TI-89 appear to take medians of halves that exclude the median, as several named textbooks do (Langford’s “Exclusive” method); Tukey’s hinges equal medians of halves that include it.
- quantile: Sample Quantiles (R documentation) The R Project The nine sample-quantile types of Hyndman and Fan (1996); type 7 is R’s default; type 6 is used by Minitab and SPSS.
- fivenum: Tukey Five-Number Summaries (R documentation) The R Project R’s fivenum() returns Tukey’s lower and upper hinges.
- statistics: Mathematical statistics functions Python Software Foundation statistics.quantiles() defaults to the “exclusive” method (i/(n + 1)); “inclusive” uses (i − 1)/(n − 1); the mode also applies to nominal data.
- numpy.percentile NumPy The default method is “linear”, Hyndman–Fan type 7.
- QUARTILE.INC function Microsoft Support Quartiles based on percentiles from 0 to 1 inclusive; the page’s example (Q1 = 3.5 for 1, 2, 4, 7, 8, 9, 10, 12) matches type 7.
- QUARTILE.EXC function Microsoft Support Quartiles based on percentiles from 0 to 1 exclusive; the page’s example (Q1 = 15, Q3 = 43) matches type 6.
- MODE.SNGL function Microsoft Support Text in a referenced range is ignored; returns