Category: FUNCTION | Updated: 2026-11-22
How to Use the MEDIAN Function | Find the Median of a Dataset
How to Use the MEDIAN Function
The MEDIAN function returns the middle value in a sorted list of numbers. It is especially useful when you want a representative value that isn’t distorted by outliers.
Syntax
=MEDIAN(value1, [value2, ...])
- value1: The first number or cell range for which to find the median (required).
- value2, …: Additional numbers or cell ranges (optional).
Example Table
An example of finding the median from 5 test scores (or salary figures). Even with an unusually high outlier, the median remains unaffected.
| Employee | Numeric Data | Metric | Formula | Result |
|---|---|---|---|---|
| Person A | 300 | Median | =MEDIAN(B2:B6) |
400 |
| Person B | 350 | (Ref) Average | =AVERAGE(B2:B6) |
690 |
| Person C | 400 | |||
| Person D | 450 | |||
| Person E | 1950 |
Note: Sorting the data in ascending order gives 300, 350, 400, 450, 1950, so the middle value 400 is returned.
Common Errors and Caveats
- #NUM! error: Occurs if the specified range contains no numeric values at all (e.g., all cells are empty or contain only text).
- Empty cells vs.
0: Empty cells and text strings in a range are ignored, whereas cells containing0are counted as numeric data points.
Frequently Asked Questions
Q. How does MEDIAN calculate the result when there is an even number of data points?
A. When the values are sorted in ascending order, MEDIAN returns the average of the two middle numbers.
Q. What is the advantage of using MEDIAN instead of AVERAGE?
A. Because MEDIAN is not skewed by extremely high or low values (outliers), it is better suited for understanding typical values in data like salaries or website traffic.