Cellwise

Math function

Excel MEDIAN function

MEDIAN sorts your numbers and returns the one in the middle. With an even count it averages the two middle values. Use it for "typical" figures like house prices or salaries, where one extreme value would skew an average.

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

Arguments

number1
The first number, cell or range.
number2
Optional. More numbers, cells or ranges, up to 255.

MEDIAN examples

Every result below was calculated live from this sample sheet.

ABC
1ListingPriceBedrooms
212 Oak St3150003
34 Elm Ave2890002
488 Lake Rd14500005
519 Pine Ct3420003
67 Birch Ln2980003
731 Cedar Dr3270004
  1. fx=MEDIAN(B2:B7)

    Result: 321000

    Six prices, so MEDIAN averages the two middle ones after sorting.

  2. fx=AVERAGE(B2:B7)-MEDIAN(B2:B7)

    Result: 182500

    How far the one mansion drags the average above the median. That gap is why MEDIAN is better for prices.

  3. fx=MEDIAN(B2:B6)

    Result: 315000

    Five prices give an odd count, so the middle value is returned as-is.

  4. fx=MEDIAN(C2:C7)

    Result: 3

    The typical number of bedrooms in these listings.

How to use MEDIAN

  1. Click an empty cell.
  2. Type =MEDIAN(
  3. Select the numbers. They do not need to be sorted.
  4. Close the bracket and press Enter.

Common MEDIAN mistakes

Sorting the data first

You do not need to. MEDIAN sorts internally and leaves your sheet alone.

Zeros used as placeholders

Zeros count as values and shift the middle. Leave unknown cells blank, because blanks are skipped.

Expecting a value from the list

With an even count, the median is the average of the two middle numbers, so it may not appear in your data.

MEDIAN FAQ

What is the difference between median and average in Excel?

AVERAGE adds everything and divides by the count. MEDIAN is the middle value. When a few values are extreme, the median is a better picture of the typical one.

How does Excel calculate the median of an even number of values?

It sorts the values and averages the two in the middle. For 2, 4, 6, 8 the median is 5.

Does MEDIAN ignore blank cells?

Yes. Blank cells and text in a range are ignored. Zeros are included.

Related functions

Updated 2026-10-31