Use the Google Sheets MEDIAN Function

Find the midmost value in a set of numbers

close up of man hand analyzing financial documents on office desk
Towfiqu Photography / Getty ImagesOwner

Along with helping you track your data, Google Sheets also lets you analyze and modify it using functions. If you have a large set of numbers and want to find the middle value, you'll want to use the MEDIAN function.

Here's how to use it.

Finding the Middle Value With the MEDIAN Function

To make it easier to measure central tendency, Google Spreadsheets has a number of functions that will calculate the more commonly used average values. These include:

  • The MEDIAN function finds the median or middle value in a list of numbers.
  • The AVERAGE function finds the arithmetic mean for a list of numbers.
  • The MODE function finds the most commonly occurring value in a list of numbers.

The MEDIAN Function's Syntax and Arguments

A function's syntax refers to the layout of the function and includes the function's name, brackets, comma separators, and arguments.

The syntax for the MEDIAN function is:

=MEDIAN (number_1, number_2, ...number_30)

number_1 - (required) the data to be included in calculating the median

number_2:number_30 - (optional) additional data values to be included in the median calculations.

The maximum number of entries you can include is 30. This rule doesn't apply if your function uses a range of cells.

The arguments can contain:

Finding the Median Mathematically

It's easiest to find a median for an odd number of values. For example, the median of a set containing the numbers 2,3, and 4 is 3. With an even number of values, you calculate the median by finding the average for the two middle values.

For example, you'd calculate the median for the numbers 2,3,4,5, by averaging the middle two numbers, 3 and 4:

 (3 + 4) / 2

that results in a median of 3.5.

How to Enter the MEDIAN Function

Finding the Middle Value with Google Spreadsheets MEDIAN Function

Once you've entered your data set into a spreadsheet, here's how to enter the function to calculate the median:

  1. Click the cell you want to enter the function into.

  2. Type = and then MEDIAN to begin the function.

  3. Open a set of parentheses by typing (.

  4. Highlight the cells you want to use to calculate the median. In the example above, you would drag from Cell A2 to Cell C2.

  5. Press the Enter key to add the closing parenthesis and to complete the function.

  6. The median will replace what you typed in the cell, but the function will still appear in the formula bar above the worksheet.

Blank Cells vs. Zero

The MEDIAN function ignores empty cells but not ones containing the numeral 0.

So for the set (4, 6, [empty cell], 8), the median would be 6 because the function reads that set as (4, 6, 8).

The set (4, 6, 0, 8), however, would have a median of 5, because the function places all of the values it's analyzing into ascending order. So it would find the average of the middle two values in the adjusted set (0, 4, 6, 8).