Excel function

MEDIANfunction

Returns the middle value (median) of the numbers.

All versions
=MEDIAN(B2:D6)
A
B
C
D
1
2
3
4
5
6

Drag the corner dots to change range. Shrink the range to the Test 2 column so the count is even: the median becomes the average of the two middle values. Try breaking it on purpose to see the errors.

Result

88

range
B2:D6Drag the corner dots on the table

The cells to calculate. Cells that are not numbers are ignored.

What is the MEDIAN function?

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

MEDIAN returns the value in the middle when the numbers are sorted. Use it instead of the average when one very large or small value would pull the average.

The sheet B2:D6 holds 11 scores, 2 "Absent" cells and 2 blank cells. With an odd count the median is the middle value; with an even count it is the average of the two middle values.

For data such as salaries or house prices, a few very large values pull the mean up, and the median is closer to a typical value. When the mean and the median are far apart, that is itself a sign of skewed data or outliers.

Arguments

number1, ...
Numbers, cells or ranges. Separate several with commas.

MEDIAN examples

  1. Example 1. Median score

    =MEDIAN(B2:D6)

    Sorted, the 11 scores have 88 in the 6th position: the median.

  2. Example 2. Even count

    =MEDIAN(1, 2, 3, 4)

    The average of 2 and 3: 2.5.

  3. Example 3. When the mean and median differ

    =MEDIAN(B2:B6)

    Five salaries in $ thousands, one of them very large. The mean is 70, but four of the five earn less; the median of 40 is more typical.

    Salaries ($k)FunctionResult
    30, 35, 40, 45, 200AVERAGE70
    MEDIAN40

Common mistakes

FAQ

Do I need to sort first?
No. The function sorts the values itself.
Most frequent value?
Use MODE.SNGL.
Median with a condition?
In versions with FILTER, use =MEDIAN(FILTER(D2:D9, A2:A9="Seoul")).