What Is the Median? How to Calculate It, With Examples

By Markets & Investing DeskUpdated Nov 10, 2026

Median
Illustration · Fintrev

Definition

The median is the middle value of a dataset once the values are sorted, so half the observations sit at or below it and half sit at or above it.

Key takeaways

  • With an odd count the median is the single middle value; with an even count it averages the two middle values.
  • In the set 3, 5, 7, 19, the mean is 8.5 but the median is 6, and swapping 19 for 1,900 leaves the median at 6.
  • When the mean is higher than the median, the data is right-skewed, as incomes, wealth and home prices typically are.
  • Averaging the medians of two groups does not give the median of the combined group, unlike weighted group means.

The median is the middle value of a dataset once the values are sorted from smallest to largest (or largest to smallest). Half of the observations sit at or below it and half sit at or above it, so it marks the midpoint of the data. In statistics the median is a measure of central tendency, like the mean and the mode, but it is calculated from position rather than from the size of every value. That difference makes it useful when a few extreme numbers would distort an ordinary average.

How to Find the Median

Finding the median takes three steps:

  1. Sort the data in ascending or descending order. Skipping this step is the most common error; the middle of an unsorted list means nothing.
  2. Count the observations (n).
  3. Locate the middle position. If n is odd, the median is the single middle value. If n is even, average the two middle values.

Median formula

For a sorted dataset x₁, x₂, … xₙ:

  • Odd n: Median = x₍ₙ₊₁₎/₂
  • Even n: Median = (xₙ/₂ + x₍ₙ/₂₎₊₁) ÷ 2

The formula gives a position, not a value. With 9 observations, (9 + 1) ÷ 2 = 5, so the median is the 5th value in the sorted list. With 10 observations, the median is the average of the 5th and 6th values.

Spreadsheets handle the sorting for you: in Excel or Google Sheets, =MEDIAN(A1:A10) returns the median of a range whether or not the cells are in order.

Examples of the Median

Odd number of values

Take the dataset 3, 13, 2, 34, 11, 26, 47. Sorted, it becomes:

2, 3, 11, 13, 26, 34, 47

There are seven values, so the median is in position (7 + 1) ÷ 2 = 4. The 4th value is 13, with three numbers below it and three above it.

Even number of values

Now take 3, 13, 2, 34, 11, 17, 27, 47. Sorted:

2, 3, 11, 13, 17, 27, 34, 47

There are eight values, so the middle pair sits in positions 4 and 5: 13 and 17. The median is (13 + 17) ÷ 2 = 15. Notice that 15 does not appear in the dataset. With an even count, the median is often a value no observation actually takes, and it can be a decimal even when every data point is a whole number.

Repeated values

Duplicates stay in the list. For 4, 7, 7, 7, 9, the median is 7, the 3rd of five values. You do not remove repeats before counting.

Median vs. Mean

The mean (arithmetic mean, or average) adds every value and divides by the count. The median ignores the size of the values and looks only at their order. On the dataset 3, 5, 7, 19:

  • Mean: (3 + 5 + 7 + 19) ÷ 4 = 34 ÷ 4 = 8.5
  • Median: (5 + 7) ÷ 2 = 6

The single large value, 19, pulls the mean upward. The median barely notices it: replace 19 with 1,900 and the median is still 6, while the mean jumps to 478.75.

The mean tells you what each observation would be if the total were shared out equally. The median describes a typical, middle observation.

Median vs. mode

The mode is the value that occurs most often. In 0, 0, 0, 1, 1, 2, 10, 10, the mode is 0, the median is 1 (the average of the 4th and 5th values, both 1), and the mean is 24 ÷ 8 = 3. Three measures of “the center” give three different answers because the data is lopsided.

When the Mean and Median Differ

In a normal distribution, the familiar symmetric bell curve, the mean, median and mode are all the same value and sit at the peak in the center. The gap between mean and median is therefore a quick signal of skew:

  • Right-skewed data (a long tail of high values): mean > median. Incomes, wealth and home prices typically look like this, because a small number of very large values stretch the upper tail.
  • Left-skewed data (a long tail of low values): mean < median.
  • Roughly symmetric data: mean ≈ median.

How the Median Is Used in Finance and Economics

Income and housing. Government statistics agencies, including the U.S. Census Bureau, report median household income rather than relying on the mean alone, because very high earners raise the average far above what a typical household earns. Median home sale prices are reported for the same reason: a handful of luxury sales can inflate the average price in a market.

Valuation comparisons. Analysts often compare a company’s price-to-earnings ratio with the median P/E of its peers. A hypothetical example shows why. Five companies trade at P/E ratios of 12, 15, 18, 22 and 140. The mean is 207 ÷ 5 = 41.4, a figure that describes none of the five companies. The median is 18, which sits close to four of them. One company with temporarily depressed earnings per share can produce an extreme multiple, and the median keeps that one reading from setting the benchmark.

Screening and ranking. In a stock screener, comparing a metric to the group median shows whether a company sits above or below the middle of its peers, a cleaner test than an average dragged around by outliers.

Performance data. Median returns across a set of funds or trades show what the middle result looked like, while the mean can be lifted or sunk by a few unusually large wins or losses.

Median, Quartiles and Percentiles

The median is the 50th percentile and the second quartile (Q2). Quartiles split sorted data into four equal parts: Q1 is the median of the lower half and Q3 is the median of the upper half. The distance from Q1 to Q3, the interquartile range, shows how spread out the middle 50% of the data is. Quintiles (five parts) and deciles (ten parts) follow the same logic. Box plots, a common chart in statistics, are built directly from the median and quartiles.

How to Interpret the Median

A median of 15 means that half the observations are 15 or lower and half are 15 or higher. It says nothing about how far the other values sit from 15. Two datasets can share a median and look completely different:

  • Dataset A: 14, 15, 15, 16
  • Dataset B: 1, 10, 20, 900

Both have a median of 15, yet A is tightly bunched and B is spread across a huge range. Reading the median alongside the mean, the range or the quartiles gives a fuller picture.

Limitations of the Median

  • It ignores magnitude. Because only order matters, the median does not change when the largest value grows tenfold. That is a strength against outliers but a weakness when the size of extreme values matters, for example when estimating total losses, total spending or total payroll. The mean times the count gives such totals; the median cannot.
  • Medians do not combine. You cannot average the medians of two groups to get the median of the combined group. With group A (1, 2, 3) and group B (10, 20, 30, 40, 50), the medians are 2 and 30, and their average is 16, but the combined median is 10. The mean does not have this problem, since group means can be weighted by group size.
  • Small samples are unstable. With few observations, adding or removing one value can move the median sharply, especially in an even-sized set where it depends on two values.

FAQs

Can a dataset have more than one median?

No. A dataset has exactly one median. With an even number of values, the two middle values are averaged into a single number. A dataset can, however, have more than one mode.

The Bottom Line

Anyone reading income figures, home prices, peer P/E ratios or fund returns can use the median to see the typical middle result without a few outliers distorting it. Because it ignores the size of extreme values, it cannot produce totals such as overall losses or payroll. Pair it with the mean, the range or the quartiles to see how widely the data spreads.

About this page

Written by Markets & Investing Desk

The Markets & Investing Desk covers investing guides, the financial dictionary, companies, people, economics and market data.

Published
Last updated

Spotted an error? Tell the editors. This page is general information, not financial advice.