How the MEDIAN Function Works

The MEDIAN function sorts through the provided arguments to find the value that falls arithmetically in the middle of the group.  If there’s an odd number of arguments, the MEDIAN function identifies the middle value in the range as the median value. If there’s an even number of arguments, the function takes the arithmetic mean or the average of the middle two values as the median value.

MEDIAN Function Syntax

A function’s syntax refers to the layout of the function and includes the function’s name, brackets, comma separators, and arguments. The following is the syntax for the MEDIAN function: =MEDIAN(Number1, Number2, Number3, …) =MEDIAN is how all MEDIAN formulas begin. Number1 refers to the required data that the function will calculate. Number2 and subsequent values refer to optional additional data values to be calculated in the average. The maximum number of entries allowed is 255, each of which must be separated by a comma. This argument can contain a list of numbers to be averaged, cell references to the location of the data in the worksheet, a range of cell references, and a named range.

MEDIAN Function Example

These steps detail how to enter the MEDIAN function and arguments using the dialog box. We’re using sample data entered into a spreadsheet, as seen below. Why is the median value 20? Since there’s an odd number of arguments in this line of data (five), the median value is calculated by finding the middle number. It’s 20 here because there are two numbers greater (49 and 65) and two numbers smaller (4 and 12).

Blank Cells vs. Zero Values

When finding the median in Excel, there’s a difference between blank or empty cells and those containing a zero value. The MEDIAN function ignores blank cells but not those containing a zero value. By default, Excel displays a zero in cells with a zero value. This option can be turned off, so if cells are left blank, the zero value for that cell is still included as an argument for the function when calculating the median. Here’s how to toggle this option on and off:

In Excel 2019, Excel 2016, Excel 2013, and Excel 2010

In Excel 2019 for Mac, Excel 2016 for Mac, and Excel for Mac 2011