Quick Answer

MEDIAN Function

Finds the central (50th percentile) value of a dataset.

✓ Excel✓ Google SheetsExcel All versions

Syntax

MEDIAN
(number1, [number2], ...)

Parameters

ParameterDescriptionRequired
number1The first number, cell, or range to evaluate.Required
number2Additional numbers, cells, or ranges (optional). Up to 255 arguments.Optional

Basic Example

Median of five ordered scores

=MEDIAN(1,2,3,4,5)
Result3

With 5 values the sorted middle (3rd) value is 3.

Advanced Examples

Example 1: Even number of values averages the two middle numbers

Four monthly figures

When the count is even, MEDIAN averages the two central values.

=MEDIAN(1,2,3,4)
Result: 2.5
The two middle values are 2 and 3; (2+3)/2 = 2.5.

Example 2: Median ignores blanks and text automatically

Mixed column with a repeated figure

MEDIAN on a range with a duplicated central value.

=MEDIAN(10,20,20,30,40)
Result: 20
Sorted, the 3rd (middle) value is 20, so the median is 20.

How MEDIAN Works

MEDIAN sorts the numeric values it receives and returns the value at the center position. With an odd count it returns the single middle value; with an even count it returns the arithmetic mean of the two middle values. Text, logical values, and empty cells are ignored.

1
Select the result cell
Click the cell where you want the median.
2
Enter the formula
Type =MEDIAN(range) using the cells to evaluate.
3
Press Enter
The middle value is returned.

Important Notes & Limitations

  • Ignores text, logical values, and empty cells, which can change the perceived count.

  • For an even number of values it returns an average, not one of the actual data points.

  • Cells with text-formatted numbers are treated as text and ignored.

Common Errors & Fixes

#NUM! errorNo numeric values were supplied to the function.

Fix: Make sure the range or arguments contain at least one number.

Unexpected resultNumbers stored as text are ignored, shrinking the dataset.

Fix: Convert text to numbers or use VALUE() before MEDIAN.

Download Practice File

Practice MEDIAN with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the MEDIAN function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

How does MEDIAN differ from AVERAGE?
MEDIAN is the middle value and is resistant to outliers; AVERAGE is the sum divided by count and is pulled by extreme values.
Does MEDIAN include zero?
Yes, zero is a real numeric value and is counted in the ordering.
What does MEDIAN return for an empty range?
It returns #NUM! because there is no numeric value to evaluate.