Practice free

MEDIAN function

MEDIAN returns the middle value of your data, so half the values are above it and half below. It beats AVERAGE when a few extreme values would skew the picture, like salaries.

Example

Read it as a sentence: find the middle value of the numbers in A1:A8, which gives 4.5.

Practice this in the app

Syntax

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

Arguments in [square brackets] are optional.

number1 (required)
First number, reference or range.
number2 (optional)
More numbers or ranges.

Returns: The middle value of the data.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=MEDIAN({2,4,4,4,5,5,7,9}) 4.5 Array constant
=MEDIAN(10,"20",TRUE) 10 Direct args: number, text-number, TRUE
=MEDIAN(5) 5 Single number
=MEDIAN({1,"2",TRUE,3}) 2 Array with text and boolean
=MEDIAN(Data!A1:A8) 4.5 Range of numbers
=MEDIAN(Data!B1:B8) 30 Mixed range: num, text-number, TRUE, blank, text, FALSE
=MEDIAN(10,"abc") #VALUE! Direct arg: non-numeric text
=MEDIAN(Data!C1:C5) #N/A Range containing #N/A

The Data sheet these formulas read

A cell that starts with = holds that formula.

Watch out for

  • With an even count it averages the two middle numbers.
  • Text and blanks in ranges are ignored.

Where it works

Excel
MEDIAN is in every version of Excel from 2007 on.
Google Sheets
Same name, same behaviour for everyday use.

Part of Statistical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .