MEDIAN
Returns the median of the given numbers.
=MEDIAN(number1, [number2], ...)This static page keeps the function indexed for search, while the spreadsheet app handles interactive exploration and saved formulas.
What the function does
Overview
Returns the median of the given numbers.
The MEDIAN function calculates the statistical midpoint of a numeric dataset. Internally, Excel sorts the provided values in ascending order and identifies the center. If the dataset contains an odd number of values, the exact middle number is returned. If the count is even, Excel calculates the arithmetic average of the two central numbers. This function is a 'robust measure of central tendency,' making it superior to AVERAGE when dealing with skewed distributions (like housing prices or employee salaries) because it is not disproportionately influenced by extreme outliers. Note that MEDIAN ignores empty cells, text, and logical values within range references. However, if these values are typed directly into the argument list, text representations of numbers and logical values will be counted. Best practice is to ensure that zero values in your range are intentional, as they will be treated as valid data points and may shift the median downward.
Quick reference
Syntax
=MEDIAN(number1, [number2], ...)
Inputs
Arguments
Example: A2:A100
Formula patterns
Examples
Median of an odd-numbered dataset
=MEDIAN(A2:A6)Median of an even-numbered dataset
=MEDIAN(B2:B9)Combining range references with constant values
=MEDIAN(C2:C10, 500, 1000)Avoid these issues
Common Errors
#NUM!
Cause: The range provided contains no numeric data or is entirely empty.
Fix: Ensure the referenced cells (e.g., A2:A10) contain at least one number.
#VALUE!
Cause: An argument provided directly in the formula (not a cell reference) is a text string that Excel cannot interpret as a number.
Fix: Check the arguments for non-numeric characters or move text data into cell references so the function can ignore them.
Platform support
Compatibility
Source: Microsoft Support
Common questions
Frequently Asked Questions
Returns the median of the given numbers.
number1: Range of numbers
#NUM!: Ensure the referenced cells (e.g., A2:A10) contain at least one number. #VALUE!: Check the arguments for non-numeric characters or move text data into cell references so the function can ignore them.