How to Find the Median: Formula, Steps, and Examples

  • The median is the middle value in an ordered numerical dataset.
  • Always arrange the values in order before identifying the median.
  • For an odd number of values, select the one value in the middle.
  • For an even number of values, average the two middle values.
  • Repeated values, negative numbers, and decimals are included normally.

Learning how to find the median is straightforward once the values have been placed in order. The method depends on whether the dataset contains an odd or even number of values.

This guide explains the median formula, provides worked examples, and covers common situations such as repeated values, decimals, negative numbers, and outliers.

What Is the Median?

The median is the middle value in an ordered numerical dataset. At least half of the values are less than or equal to the median, and at least half are greater than or equal to it.

For example, consider the ordered dataset:

3, 7, 9

The middle value is 7, so the median is 7.

The median is a measure of central tendency, along with the mean and mode. Unlike the mean, which is calculated using every value, the median is determined mainly by the positions of the values after they have been sorted.

How to Find the Median in 3 Steps

Follow these steps:

  1. Arrange all the values from smallest to largest.
  2. Count the total number of values.
  3. Use the odd-number or even-number method.

If the dataset contains an odd number of values, choose the single middle value.

If it contains an even number of values, add the two middle values and divide the result by two.

Sorting is essential. Do not select a middle value until the dataset has been placed in numerical order.

Dataset typePosition or methodExampleMedian
Odd number of valuesUse position (n + 1) ÷ 22, 4, 7, 9, 117
Even number of valuesAverage positions n ÷ 2 and (n ÷ 2) + 12, 4, 8, 106

In these formulas, n represents the total number of values.

Finding the Median With an Odd Number of Values

Consider this dataset:

12, 3, 9, 5, 7

First, arrange the numbers from smallest to largest:

3, 5, 7, 9, 12

There are five values. The third value is in the middle, so the median is:

Median = 7

For an odd number of values, use the following formula to locate the middle position:

Median position = (n + 1) ÷ 2

Here, n = 5:

(5 + 1) ÷ 2 = 3

The median is therefore the value in the third position, which is 7.

Finding the Median With an Even Number of Values

Consider this dataset:

10, 4, 8, 2

Arrange the numbers in order:

2, 4, 8, 10

There are four values, so there is no single middle value. The two middle values are 4 and 8.

Add them and divide by two:

Median = (4 + 8) ÷ 2

Median = 12 ÷ 2

Median = 6

For an even number of values, the middle positions are:

First middle position = n ÷ 2

Second middle position = (n ÷ 2) + 1

When n = 4, the middle positions are 2 and 3.

The median of an even-sized dataset does not have to be one of the original values. In this example, 6 does not appear in the dataset.

Finding the Median in Special Cases

Repeated values

Keep every repeated value because each observation counts.

For example:

2, 2, 5, 8, 9

There are five values, and the middle value is 5. The median is therefore 5.

Removing one of the repeated values would change the size of the dataset and could change the answer.

Negative numbers

Negative numbers follow their normal numerical order.

For example:

-8, -3, -1

The middle value is -3, so the median is -3.

Remember that a more negative number is smaller. Therefore, -8 comes before -3.

Decimals

Decimals are handled in the same way as whole numbers.

Consider:

1.2, 2.5, 4.8, 7.1

There are four values, so average the two middle values:

Median = (2.5 + 4.8) ÷ 2

Median = 7.3 ÷ 2

Median = 3.65

A dataset with one value

When a dataset contains only one value, that value is the median.

For example, the median of:

14

is 14.

An empty dataset

An empty dataset has no median because it contains no values and has no middle position.

Median vs. Mean: When Is the Median More Useful?

The median is particularly useful when a dataset is skewed or contains an unusually high or low value.

Consider these home repair costs:

20, 22, 24, 25, 300

The median is the middle value:

Median = 24

The mean is:

Mean = (20 + 22 + 24 + 25 + 300) ÷ 5

Mean = 78.2

The unusually large value of 300 pulls the mean upward. The median remains 24, which may better represent a typical value in this dataset.

For this reason, the median is often useful when describing:

  • Salaries and household incomes
  • Property prices
  • Waiting times
  • Travel times
  • Medical costs
  • Other skewed datasets

The median is less sensitive to extreme values than the mean, although adding, removing, or changing observations can still affect it.

Common Mistakes to Avoid

Forgetting to sort the values

The values must be placed in numerical order before the middle can be identified.

For example, the middle entry in:

12, 3, 9, 5, 7

is 9, but 9 is not the median. After sorting the values, the actual middle value is 7.

Using only one middle value in an even-sized dataset

When the dataset contains an even number of values, average both middle values. Do not choose only one of them.

Removing repeated values

Repeated values are valid observations. Removing them changes the dataset and may change the median.

Dividing by the total number of values

Dividing the sum of all values by the number of values calculates the mean, not the median. The median is found from the middle position after sorting.

Frequently Asked Questions

Can I find the median without sorting the numbers?

Not reliably by hand. The values must be ranked before you can identify the middle observation or observations. Sorting from smallest to largest is usually the clearest approach.

What is the median of a dataset with one number?

The single value is the median. For example, the median of 17 is 17.

Is the median the same as the 50th percentile?

Yes. In a standard numerical dataset, the median represents the 50th percentile and divides the ordered data into a lower half and an upper half.

How do I find the median in Excel or Google Sheets?

Use the MEDIAN function:

=MEDIAN(A1:A10)

Replace A1:A10 with the range containing your data.

How do I find the median from a frequency table?

First, add the frequencies to find the total number of observations. Then use the cumulative frequencies to locate the middle position.

For a small frequency table, you can also write out each value the number of times shown by its frequency and then use the standard median method.

What happens if the two middle values are the same?

Their average is the same number.

For example:

2, 5, 5, 9

The two middle values are both 5:

Median = (5 + 5) ÷ 2 = 5